From 960f35a066d446ade845f041d149c44ee37a2ac5 Mon Sep 17 00:00:00 2001 From: Eliad Moosavi Date: Mon, 6 Jul 2020 11:22:06 -0400 Subject: [PATCH 1/4] fix(core): respect addSpaceOnEdges when initializing axes --- packages/core/src/components/axes/axis.ts | 97 ++++++++++++++--------- 1 file changed, 60 insertions(+), 37 deletions(-) diff --git a/packages/core/src/components/axes/axis.ts b/packages/core/src/components/axes/axis.ts index 4e8c309768..eae06807ec 100644 --- a/packages/core/src/components/axes/axis.ts +++ b/packages/core/src/components/axes/axis.ts @@ -1,6 +1,13 @@ // Internal Imports import { Component } from "../component"; -import { AxisPositions, Events, ScaleTypes, Roles, TooltipTypes, TruncationTypes } from "../../interfaces"; +import { + AxisPositions, + Events, + ScaleTypes, + Roles, + TooltipTypes, + TruncationTypes +} from "../../interfaces"; import { Tools } from "../../tools"; import { ChartModel } from "../../model"; import { DOMUtils } from "../../services"; @@ -8,7 +15,7 @@ import * as Configuration from "../../configuration"; import { computeTimeIntervalName, formatTick, - isTickPrimary, + isTickPrimary } from "../../services/time-series"; // D3 Imports @@ -69,7 +76,7 @@ export class Axis extends Component { const svg = this.getContainerSVG(); const { width, height } = DOMUtils.getSVGElementSize(this.parent, { - useAttrs: true, + useAttrs: true }); let startPosition, endPosition; @@ -144,7 +151,7 @@ export class Axis extends Component { "0" ); const tickHeight = DOMUtils.getSVGElementSize(fakeTickText.node(), { - useBBox: true, + useBBox: true }).height; fakeTick.remove(); @@ -186,20 +193,24 @@ export class Axis extends Component { if (!scale.ticks(numberOfTicks).length) { axis.tickValues([]); } else { - const tickValues = scale - .nice(numberOfTicks) - .ticks(numberOfTicks); + const addSpaceOnEdges = Tools.getProperty( + options, + "timeScale", + "addSpaceOnEdges" + ); + + let tickValues; + if (addSpaceOnEdges) { + tickValues = scale + .nice(numberOfTicks) + .ticks(numberOfTicks); + } else { + tickValues = scale.ticks(numberOfTicks); + } // Remove labels on the edges // If there are more than 2 labels to show - if ( - Tools.getProperty( - options, - "timeScale", - "addSpaceOnEdges" - ) && - tickValues.length > 2 - ) { + if (addSpaceOnEdges && tickValues.length > 2) { tickValues.splice(tickValues.length - 1, 1); tickValues.splice(0, 1); } @@ -306,7 +317,7 @@ export class Axis extends Component { const { height: titleHeight } = DOMUtils.getSVGElementSize( axisTitleRef, { - useBBox: true, + useBBox: true } ); axisTitleRef @@ -435,24 +446,31 @@ export class Axis extends Component { // truncate the label if it's too long // only applies to discrete type - if (truncationType !== TruncationTypes.NONE && axisScaleType === ScaleTypes.LABELS) { + if ( + truncationType !== TruncationTypes.NONE && + axisScaleType === ScaleTypes.LABELS + ) { const dataGroups = this.model.getDataValuesGroupedByKeys(); if (dataGroups.length > 0) { - const activeDataGroups = dataGroups.map(d => d.sharedStackKey); - const tick_html = svg.select( - `g.axis.${axisPosition} g.ticks g.tick` - ).html(); + const activeDataGroups = dataGroups.map( + (d) => d.sharedStackKey + ); + const tick_html = svg + .select(`g.axis.${axisPosition} g.ticks g.tick`) + .html(); - container - .selectAll("g.ticks g.tick") - .html(tick_html); + container.selectAll("g.ticks g.tick").html(tick_html); container .selectAll("g.tick text") .data(activeDataGroups) - .text(function(d) { + .text(function (d) { if (d.length > truncationThreshold) { - return Tools.truncateLabel(d, truncationType, truncationNumCharacter); + return Tools.truncateLabel( + d, + truncationType, + truncationNumCharacter + ); } else { return d; } @@ -461,9 +479,13 @@ export class Axis extends Component { this.getInvisibleAxisRef() .selectAll("g.tick text") .data(activeDataGroups) - .text(function(d) { + .text(function (d) { if (d.length > truncationThreshold) { - return Tools.truncateLabel(d, truncationType, truncationNumCharacter); + return Tools.truncateLabel( + d, + truncationType, + truncationNumCharacter + ); } else { return d; } @@ -473,9 +495,7 @@ export class Axis extends Component { .selectAll("g.ticks") .html(this.getInvisibleAxisRef().html()); - container - .selectAll("g.tick text") - .data(activeDataGroups); + container.selectAll("g.tick text").data(activeDataGroups); } } // Add event listeners to elements drawn @@ -511,7 +531,7 @@ export class Axis extends Component { Events.Axis.LABEL_MOUSEOVER, { element: select(this), - datum, + datum } ); }) @@ -521,13 +541,16 @@ export class Axis extends Component { Events.Axis.LABEL_MOUSEMOVE, { element: select(this), - datum, + datum } ); - if (axisScaleType === ScaleTypes.LABELS && datum.length > truncationThreshold) { + if ( + axisScaleType === ScaleTypes.LABELS && + datum.length > truncationThreshold + ) { self.services.events.dispatchEvent(Events.Tooltip.SHOW, { hoveredElement: select(this), - type: TooltipTypes.AXISLABEL, + type: TooltipTypes.AXISLABEL }); } }) @@ -535,14 +558,14 @@ export class Axis extends Component { // Dispatch mouse event self.services.events.dispatchEvent(Events.Axis.LABEL_CLICK, { element: select(this), - datum, + datum }); }) .on("mouseout", function (datum) { // Dispatch mouse event self.services.events.dispatchEvent(Events.Axis.LABEL_MOUSEOUT, { element: select(this), - datum, + datum }); if (axisScaleType === ScaleTypes.LABELS) { self.services.events.dispatchEvent(Events.Tooltip.HIDE); From 073080ba67e175c581e0560580f3d3d504e5eafe Mon Sep 17 00:00:00 2001 From: Eliad Moosavi Date: Mon, 6 Jul 2020 11:22:16 -0400 Subject: [PATCH 2/4] format --- packages/core/.storybook/config.js | 2 +- packages/core/.storybook/main.js | 12 +- packages/core/.storybook/theme.js | 4 +- packages/core/CHANGELOG.md | 486 ++++++++++++------ packages/core/README.md | 26 +- packages/core/demo/create-codesandbox.ts | 38 +- packages/core/demo/data/bar.ts | 244 +++++---- packages/core/demo/data/bubble.ts | 58 +-- packages/core/demo/data/index.ts | 12 +- packages/core/demo/data/line.ts | 144 +++--- packages/core/demo/data/pie.ts | 10 +- packages/core/demo/data/radar.ts | 24 +- packages/core/demo/data/scatter.ts | 80 +-- packages/core/demo/data/step.ts | 12 +- packages/core/demo/data/time-series-axis.ts | 214 ++++---- packages/core/karma.conf.js | 34 +- packages/core/rollup.config.js | 10 +- packages/core/rollup.demo.js | 6 +- packages/core/src/axis-chart.ts | 40 +- packages/core/src/charts/area-stacked.ts | 6 +- packages/core/src/charts/area.ts | 6 +- packages/core/src/charts/bar-grouped.ts | 6 +- packages/core/src/charts/bar-simple.ts | 6 +- packages/core/src/charts/bar-stacked.ts | 6 +- packages/core/src/charts/bubble.ts | 6 +- packages/core/src/charts/donut.ts | 6 +- packages/core/src/charts/gauge.ts | 5 +- packages/core/src/charts/line.ts | 6 +- packages/core/src/charts/pie.ts | 6 +- packages/core/src/charts/radar.ts | 2 +- packages/core/src/charts/scatter.ts | 6 +- packages/core/src/components/axes/grid.ts | 2 +- packages/core/src/components/axes/ruler.ts | 4 +- .../components/axes/two-dimensional-axes.ts | 8 +- .../core/src/components/axes/zero-line.ts | 4 +- .../core/src/components/essentials/legend.ts | 42 +- .../src/components/essentials/threshold.ts | 22 +- .../core/src/components/essentials/title.ts | 4 +- .../src/components/essentials/tooltip-bar.ts | 24 +- .../core/src/components/essentials/tooltip.ts | 22 +- .../src/components/graphs/area-stacked.ts | 4 +- .../core/src/components/graphs/bar-grouped.ts | 14 +- .../core/src/components/graphs/bar-simple.ts | 12 +- .../core/src/components/graphs/bar-stacked.ts | 14 +- packages/core/src/components/graphs/gauge.ts | 35 +- packages/core/src/components/graphs/line.ts | 4 +- packages/core/src/components/graphs/pie.ts | 24 +- packages/core/src/components/graphs/radar.ts | 32 +- .../src/components/graphs/scatter-stacked.ts | 8 +- .../core/src/components/graphs/scatter.ts | 22 +- .../core/src/components/graphs/skeleton.ts | 6 +- packages/core/src/components/layout/layout.ts | 8 +- packages/core/src/configuration.ts | 22 +- packages/core/src/interfaces/a11y.ts | 2 +- packages/core/src/interfaces/charts.ts | 16 +- packages/core/src/interfaces/enums.ts | 4 +- packages/core/src/interfaces/events.ts | 26 +- packages/core/src/model.ts | 7 +- packages/core/src/polyfills.ts | 2 +- packages/core/src/services/angle-utils.ts | 16 +- packages/core/src/services/colorPalettes.ts | 4 +- packages/core/src/services/colors.ts | 2 +- packages/core/src/services/curves.ts | 4 +- .../core/src/services/essentials/dom-utils.ts | 12 +- .../core/src/services/essentials/events.ts | 2 +- .../core/src/services/scales-cartesian.ts | 34 +- .../core/src/services/time-series.spec.ts | 38 +- packages/core/src/services/time-series.ts | 4 +- packages/core/src/tests/test-environment.ts | 4 +- packages/core/src/tools.spec.ts | 32 +- packages/core/src/tools.ts | 20 +- packages/core/stories/all.stories.ts | 4 +- packages/core/stories/tutorials.stories.ts | 2 +- packages/vue/CHANGELOG.md | 39 +- 74 files changed, 1163 insertions(+), 971 deletions(-) diff --git a/packages/core/.storybook/config.js b/packages/core/.storybook/config.js index e4cef8844e..1336385b5b 100644 --- a/packages/core/.storybook/config.js +++ b/packages/core/.storybook/config.js @@ -8,7 +8,7 @@ setOptions({ sortStoriesByKind: true, panelPosition: "bottom", showDownPanel: true, - theme, + theme }); const req = require.context("../stories", true, /.stories.ts$/); diff --git a/packages/core/.storybook/main.js b/packages/core/.storybook/main.js index 679bc377a3..e4014c4fd6 100644 --- a/packages/core/.storybook/main.js +++ b/packages/core/.storybook/main.js @@ -12,13 +12,13 @@ module.exports = { loader: "sass-loader", options: { sassOptions: { - includePaths: [path.resolve(__dirname + "../src")], - }, - }, - }, - ], + includePaths: [path.resolve(__dirname + "../src")] + } + } + } + ] }); return config; - }, + } }; diff --git a/packages/core/.storybook/theme.js b/packages/core/.storybook/theme.js index 01ce80b0cf..228f9ea800 100644 --- a/packages/core/.storybook/theme.js +++ b/packages/core/.storybook/theme.js @@ -9,7 +9,7 @@ const { ui01, ui03, ui04, - uiBackground, + uiBackground } = g10; const { uiBackground: secondaryColor } = g100; @@ -42,5 +42,5 @@ export default create({ inputBg: field01, inputBorder: ui03, inputTextColor: text01, - inputBorderRadius: 0, + inputBorderRadius: 0 }); diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 498385e683..0e12b34d14 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,85 +1,51 @@ # Change Log -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +All notable changes to this project will be documented in this file. See +[Conventional Commits](https://conventionalcommits.org) for commit guidelines. ## [0.32.12](https://github.com/carbon-design-system/carbon-charts/compare/v0.32.11...v0.32.12) (2020-06-26) **Note:** Version bump only for package @carbon/charts - - - - ## [0.32.11](https://github.com/carbon-design-system/carbon-charts/compare/v0.32.10...v0.32.11) (2020-06-24) **Note:** Version bump only for package @carbon/charts - - - - ## [0.32.10](https://github.com/carbon-design-system/carbon-charts/compare/v0.32.9...v0.32.10) (2020-06-24) - ### Bug Fixes -* **core:** fix gauge charts without a delta number ([#680](https://github.com/carbon-design-system/carbon-charts/issues/680)) ([f65a084](https://github.com/carbon-design-system/carbon-charts/commit/f65a084bb66f1e8241fdbd6b101daf98d059d548)) - - - - +- **core:** fix gauge charts without a delta number + ([#680](https://github.com/carbon-design-system/carbon-charts/issues/680)) + ([f65a084](https://github.com/carbon-design-system/carbon-charts/commit/f65a084bb66f1e8241fdbd6b101daf98d059d548)) ## [0.32.9](https://github.com/carbon-design-system/carbon-charts/compare/v0.32.8...v0.32.9) (2020-06-23) **Note:** Version bump only for package @carbon/charts - - - - ## [0.32.8](https://github.com/carbon-design-system/carbon-charts/compare/v0.32.7...v0.32.8) (2020-06-19) **Note:** Version bump only for package @carbon/charts - - - - ## [0.32.7](https://github.com/carbon-design-system/carbon-charts/compare/v0.32.6...v0.32.7) (2020-06-16) **Note:** Version bump only for package @carbon/charts - - - - ## [0.32.6](https://github.com/carbon-design-system/carbon-charts/compare/v0.32.5...v0.32.6) (2020-06-12) **Note:** Version bump only for package @carbon/charts - - - - ## [0.32.5](https://github.com/carbon-design-system/carbon-charts/compare/v0.32.4...v0.32.5) (2020-06-11) **Note:** Version bump only for package @carbon/charts - - - - ## [0.32.4](https://github.com/carbon-design-system/carbon-charts/compare/v0.32.3...v0.32.4) (2020-06-10) - ### Bug Fixes -* update tslint and prettier options ([#661](https://github.com/carbon-design-system/carbon-charts/issues/661)) ([ebc53d9](https://github.com/carbon-design-system/carbon-charts/commit/ebc53d9f4caea047f656ae98075b9c8ca307b280)) - - - - +- update tslint and prettier options + ([#661](https://github.com/carbon-design-system/carbon-charts/issues/661)) + ([ebc53d9](https://github.com/carbon-design-system/carbon-charts/commit/ebc53d9f4caea047f656ae98075b9c8ca307b280)) ## [0.32.3](https://github.com/carbon-design-system/carbon-charts/compare/v0.32.2...v0.32.3) (2020-06-08) @@ -89,27 +55,34 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Bug Fixes -- **core, angular, react, vue, svelte:** fix scatter graph data updates ([#654](https://github.com/carbon-design-system/carbon-charts/issues/654)) ([673d627](https://github.com/carbon-design-system/carbon-charts/commit/673d627f47274b9815ef94e4a48bb25485e1b9a3)) +- **core, angular, react, vue, svelte:** fix scatter graph data updates + ([#654](https://github.com/carbon-design-system/carbon-charts/issues/654)) + ([673d627](https://github.com/carbon-design-system/carbon-charts/commit/673d627f47274b9815ef94e4a48bb25485e1b9a3)) ## [0.32.1](https://github.com/carbon-design-system/carbon-charts/compare/v0.32.0...v0.32.1) (2020-06-03) ### Bug Fixes -- fix missing title option in charts interface ([b74d658](https://github.com/carbon-design-system/carbon-charts/commit/b74d6582277632c8a2a1f460f3ce73aadd40e500)) +- fix missing title option in charts interface + ([b74d658](https://github.com/carbon-design-system/carbon-charts/commit/b74d6582277632c8a2a1f460f3ce73aadd40e500)) # [0.32.0](https://github.com/carbon-design-system/carbon-charts/compare/v0.30.24...v0.32.0) (2020-05-29) ### Bug Fixes -- **core:** threshold - support non JS-date values ([a132497](https://github.com/carbon-design-system/carbon-charts/commit/a1324972fa5266151b490cb7eeed92a92da5b2c4)) -- **svelte:** copy svelte source to dist/src ([492a504](https://github.com/carbon-design-system/carbon-charts/commit/492a50470d2b64793bd2c67c4115bb2732bc44f7)) +- **core:** threshold - support non JS-date values + ([a132497](https://github.com/carbon-design-system/carbon-charts/commit/a1324972fa5266151b490cb7eeed92a92da5b2c4)) +- **svelte:** copy svelte source to dist/src + ([492a504](https://github.com/carbon-design-system/carbon-charts/commit/492a50470d2b64793bd2c67c4115bb2732bc44f7)) # [0.31.0](https://github.com/carbon-design-system/carbon-charts/compare/v0.30.24...v0.31.0) (2020-05-29) ### Bug Fixes -- **core:** threshold - support non JS-date values ([a132497](https://github.com/carbon-design-system/carbon-charts/commit/a1324972fa5266151b490cb7eeed92a92da5b2c4)) -- **svelte:** copy svelte source to dist/src ([492a504](https://github.com/carbon-design-system/carbon-charts/commit/492a50470d2b64793bd2c67c4115bb2732bc44f7)) +- **core:** threshold - support non JS-date values + ([a132497](https://github.com/carbon-design-system/carbon-charts/commit/a1324972fa5266151b490cb7eeed92a92da5b2c4)) +- **svelte:** copy svelte source to dist/src + ([492a504](https://github.com/carbon-design-system/carbon-charts/commit/492a50470d2b64793bd2c67c4115bb2732bc44f7)) ## [0.30.24](https://github.com/carbon-design-system/carbon-charts/compare/v0.30.23...v0.30.24) (2020-05-15) @@ -155,7 +128,8 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Bug Fixes -- **core:** Support for Horizontal Line and Scatter Chart ([28b571f](https://github.com/carbon-design-system/carbon-charts/commit/28b571fa4565de5b81a5a178776eb701a88bfe91)) +- **core:** Support for Horizontal Line and Scatter Chart + ([28b571f](https://github.com/carbon-design-system/carbon-charts/commit/28b571fa4565de5b81a5a178776eb701a88bfe91)) ## [0.30.13](https://github.com/carbon-design-system/carbon-charts/compare/v0.30.12...v0.30.13) (2020-04-20) @@ -165,7 +139,9 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Bug Fixes -- **core:** fix backwards compatibility for pie/donut ([#576](https://github.com/carbon-design-system/carbon-charts/issues/576)) ([aed1a4d](https://github.com/carbon-design-system/carbon-charts/commit/aed1a4dbb2d5ff8f85ac29b69b32c1035a326071)) +- **core:** fix backwards compatibility for pie/donut + ([#576](https://github.com/carbon-design-system/carbon-charts/issues/576)) + ([aed1a4d](https://github.com/carbon-design-system/carbon-charts/commit/aed1a4dbb2d5ff8f85ac29b69b32c1035a326071)) ## [0.30.11](https://github.com/carbon-design-system/carbon-charts/compare/v0.30.10...v0.30.11) (2020-04-15) @@ -175,13 +151,16 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Bug Fixes -- **core:** title string contains html ascii characters ([#547](https://github.com/carbon-design-system/carbon-charts/issues/547)) ([1a6b646](https://github.com/carbon-design-system/carbon-charts/commit/1a6b6463f576c1ba297883e734a4a953e4a22829)) +- **core:** title string contains html ascii characters + ([#547](https://github.com/carbon-design-system/carbon-charts/issues/547)) + ([1a6b646](https://github.com/carbon-design-system/carbon-charts/commit/1a6b6463f576c1ba297883e734a4a953e4a22829)) ## [0.30.9](https://github.com/carbon-design-system/carbon-charts/compare/v0.30.8...v0.30.9) (2020-04-09) ### Bug Fixes -- **bar-stacked:** render 0 value bars ([425e11d](https://github.com/carbon-design-system/carbon-charts/commit/425e11d9dacb8bbaf9740759754eab1f0aa45843)) +- **bar-stacked:** render 0 value bars + ([425e11d](https://github.com/carbon-design-system/carbon-charts/commit/425e11d9dacb8bbaf9740759754eab1f0aa45843)) ## [0.30.8](https://github.com/carbon-design-system/carbon-charts/compare/v0.30.7...v0.30.8) (2020-04-03) @@ -191,7 +170,10 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Bug Fixes -- **core:** update import path carbon-components ([e9fca73](https://github.com/carbon-design-system/carbon-charts/commit/e9fca73cd3768b1b85247a2798908c26da99216b)), closes [#546](https://github.com/carbon-design-system/carbon-charts/issues/546) +- **core:** update import path carbon-components + ([e9fca73](https://github.com/carbon-design-system/carbon-charts/commit/e9fca73cd3768b1b85247a2798908c26da99216b)), + closes + [#546](https://github.com/carbon-design-system/carbon-charts/issues/546) ## [0.30.6](https://github.com/carbon-design-system/carbon-charts/compare/v0.30.5...v0.30.6) (2020-03-30) @@ -221,12 +203,16 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Bug Fixes -- **core:** fix default axes creation logic ([e4fb861](https://github.com/carbon-design-system/carbon-charts/commit/e4fb86185f04ff42cbe7dc003c05556586f6c518)) +- **core:** fix default axes creation logic + ([e4fb861](https://github.com/carbon-design-system/carbon-charts/commit/e4fb86185f04ff42cbe7dc003c05556586f6c518)) ### Features -- **core:** Add configuration option to not include 0 on axes ([44d51de](https://github.com/carbon-design-system/carbon-charts/commit/44d51ded6af78d57a848d68e093fe69858405594)) -- **core:** Axes configuration options defaultable, Add option to not include 0 on axes ([03969c3](https://github.com/carbon-design-system/carbon-charts/commit/03969c319248064cf1c1ef6eb79ec534aa04c972)) +- **core:** Add configuration option to not include 0 on axes + ([44d51de](https://github.com/carbon-design-system/carbon-charts/commit/44d51ded6af78d57a848d68e093fe69858405594)) +- **core:** Axes configuration options defaultable, Add option to not include + 0 on axes + ([03969c3](https://github.com/carbon-design-system/carbon-charts/commit/03969c319248064cf1c1ef6eb79ec534aa04c972)) ## [0.29.8](https://github.com/carbon-design-system/carbon-charts/compare/v0.29.7...v0.29.8) (2020-03-03) @@ -248,13 +234,16 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Bug Fixes -- **core:** Tools.getProperty did return 'null' for falsy values, now returns the actual values ([3b78c3a](https://github.com/carbon-design-system/carbon-charts/commit/3b78c3a27d4551e7d7b51f911ea2f7e0f155ef42)) +- **core:** Tools.getProperty did return 'null' for falsy values, now returns + the actual values + ([3b78c3a](https://github.com/carbon-design-system/carbon-charts/commit/3b78c3a27d4551e7d7b51f911ea2f7e0f155ef42)) ## [0.29.3](https://github.com/carbon-design-system/carbon-charts/compare/v0.29.2...v0.29.3) (2020-02-20) ### Bug Fixes -- **build:** fix bundle output for core ([4d3d6b4](https://github.com/carbon-design-system/carbon-charts/commit/4d3d6b450fe54b55479aeaffc3706b28d926fffa)) +- **build:** fix bundle output for core + ([4d3d6b4](https://github.com/carbon-design-system/carbon-charts/commit/4d3d6b450fe54b55479aeaffc3706b28d926fffa)) ## [0.29.2](https://github.com/carbon-design-system/carbon-charts/compare/v0.29.1...v0.29.2) (2020-02-18) @@ -268,22 +257,35 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Bug Fixes -- **bar:** tooltip to render bar should provide original datapoint ([ed04f98](https://github.com/carbon-design-system/carbon-charts/commit/ed04f98891a783d8d5bbc77f9dfdb8d1ed8a46b1)) -- **charts:** simplify the interface to match ([96da97b](https://github.com/carbon-design-system/carbon-charts/commit/96da97b59c2e22cb661b9297f1cb4ace9bb8ec9e)) -- **line:** remove console.logs ([5e0413f](https://github.com/carbon-design-system/carbon-charts/commit/5e0413f6c77ae17f74818c04ed2bdf82f386fa58)) -- **lint:** fix linting errors with format ([04cdefd](https://github.com/carbon-design-system/carbon-charts/commit/04cdefda021ef1dee948231e8713481b9439f287)) -- **scatter:** custom point colors demo ([f367f83](https://github.com/carbon-design-system/carbon-charts/commit/f367f8337df8b45811afbc3eee0a3a6d3b6f8bcc)) -- **scatter:** simplify the callback parameters ([c541e8a](https://github.com/carbon-design-system/carbon-charts/commit/c541e8a4a83d026bb5b9c28afe39f749064b3b24)) -- **styles:** don't import and use carbon themes in styles.scss ([1da8b3e](https://github.com/carbon-design-system/carbon-charts/commit/1da8b3e2ba770c06dc74fe2bf08393e3d6b6778c)) -- **tooltip:** need to pass the datum along with the tooltip calls ([3bd7bfc](https://github.com/carbon-design-system/carbon-charts/commit/3bd7bfc1d435cb4ba3636361cdbbfe16de10d9d5)) -- **tooltip:** stroke color should always be default ([b3b6812](https://github.com/carbon-design-system/carbon-charts/commit/b3b6812d9fac5964ae50053332840be8d1b7246f)) -- **tooltip:** use original line color in the tooltip ([f42d245](https://github.com/carbon-design-system/carbon-charts/commit/f42d2458bdd104898f79d1b7103bcd055bdb1cdf)) +- **bar:** tooltip to render bar should provide original datapoint + ([ed04f98](https://github.com/carbon-design-system/carbon-charts/commit/ed04f98891a783d8d5bbc77f9dfdb8d1ed8a46b1)) +- **charts:** simplify the interface to match + ([96da97b](https://github.com/carbon-design-system/carbon-charts/commit/96da97b59c2e22cb661b9297f1cb4ace9bb8ec9e)) +- **line:** remove console.logs + ([5e0413f](https://github.com/carbon-design-system/carbon-charts/commit/5e0413f6c77ae17f74818c04ed2bdf82f386fa58)) +- **lint:** fix linting errors with format + ([04cdefd](https://github.com/carbon-design-system/carbon-charts/commit/04cdefda021ef1dee948231e8713481b9439f287)) +- **scatter:** custom point colors demo + ([f367f83](https://github.com/carbon-design-system/carbon-charts/commit/f367f8337df8b45811afbc3eee0a3a6d3b6f8bcc)) +- **scatter:** simplify the callback parameters + ([c541e8a](https://github.com/carbon-design-system/carbon-charts/commit/c541e8a4a83d026bb5b9c28afe39f749064b3b24)) +- **styles:** don't import and use carbon themes in styles.scss + ([1da8b3e](https://github.com/carbon-design-system/carbon-charts/commit/1da8b3e2ba770c06dc74fe2bf08393e3d6b6778c)) +- **tooltip:** need to pass the datum along with the tooltip calls + ([3bd7bfc](https://github.com/carbon-design-system/carbon-charts/commit/3bd7bfc1d435cb4ba3636361cdbbfe16de10d9d5)) +- **tooltip:** stroke color should always be default + ([b3b6812](https://github.com/carbon-design-system/carbon-charts/commit/b3b6812d9fac5964ae50053332840be8d1b7246f)) +- **tooltip:** use original line color in the tooltip + ([f42d245](https://github.com/carbon-design-system/carbon-charts/commit/f42d2458bdd104898f79d1b7103bcd055bdb1cdf)) ### Features -- **core:** parse non JS date objects within the model ([a410fa4](https://github.com/carbon-design-system/carbon-charts/commit/a410fa415fb967ef0529495b300a0327cc4d474b)) -- **scatter:** add getIsFilled to model ([a160159](https://github.com/carbon-design-system/carbon-charts/commit/a160159ee0fa188ce174ef36f022ad44caf77aeb)) -- **scatter:** enhance custom stroke and fill colors ([64cfbb6](https://github.com/carbon-design-system/carbon-charts/commit/64cfbb657c6089ab75cf132f09a49d5da75d4c4f)) +- **core:** parse non JS date objects within the model + ([a410fa4](https://github.com/carbon-design-system/carbon-charts/commit/a410fa415fb967ef0529495b300a0327cc4d474b)) +- **scatter:** add getIsFilled to model + ([a160159](https://github.com/carbon-design-system/carbon-charts/commit/a160159ee0fa188ce174ef36f022ad44caf77aeb)) +- **scatter:** enhance custom stroke and fill colors + ([64cfbb6](https://github.com/carbon-design-system/carbon-charts/commit/64cfbb657c6089ab75cf132f09a49d5da75d4c4f)) ## [0.28.1](https://github.com/carbon-design-system/carbon-charts/compare/v0.28.0...v0.28.1) (2020-01-30) @@ -293,36 +295,50 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Features -- **core:** add support for horizontal bar charts ([#415](https://github.com/carbon-design-system/carbon-charts/issues/415)) ([6a480f0](https://github.com/carbon-design-system/carbon-charts/commit/6a480f0)) +- **core:** add support for horizontal bar charts + ([#415](https://github.com/carbon-design-system/carbon-charts/issues/415)) + ([6a480f0](https://github.com/carbon-design-system/carbon-charts/commit/6a480f0)) # [0.27.0](https://github.com/carbon-design-system/carbon-charts/compare/v0.26.1...v0.27.0) (2020-01-20) ### Bug Fixes -- **chart:** update isLegendEnabled instead of isEnabled ([d413a8c](https://github.com/carbon-design-system/carbon-charts/commit/d413a8c)) -- **enabled:** rename visible to enabled ([ac4862f](https://github.com/carbon-design-system/carbon-charts/commit/ac4862f)) -- **lint:** whitespace tslint issue ([53216f5](https://github.com/carbon-design-system/carbon-charts/commit/53216f5)) +- **chart:** update isLegendEnabled instead of isEnabled + ([d413a8c](https://github.com/carbon-design-system/carbon-charts/commit/d413a8c)) +- **enabled:** rename visible to enabled + ([ac4862f](https://github.com/carbon-design-system/carbon-charts/commit/ac4862f)) +- **lint:** whitespace tslint issue + ([53216f5](https://github.com/carbon-design-system/carbon-charts/commit/53216f5)) ### Features -- **chart:** legend.visible = false to hide the legend ([6461128](https://github.com/carbon-design-system/carbon-charts/commit/6461128)) +- **chart:** legend.visible = false to hide the legend + ([6461128](https://github.com/carbon-design-system/carbon-charts/commit/6461128)) ## [0.26.1](https://github.com/carbon-design-system/carbon-charts/compare/v0.26.0...v0.26.1) (2020-01-20) ### Bug Fixes -- **axis:** better support small time scales ([8cfa595](https://github.com/carbon-design-system/carbon-charts/commit/8cfa595)) -- **axis:** fix lint issue ([debeed9](https://github.com/carbon-design-system/carbon-charts/commit/debeed9)) -- **axis:** fix linting errors ([f810d4a](https://github.com/carbon-design-system/carbon-charts/commit/f810d4a)) -- **axis:** remove confusing timeRangeToExtend property ([0456e24](https://github.com/carbon-design-system/carbon-charts/commit/0456e24)) -- **config:** add additional property to control extension ([2da3404](https://github.com/carbon-design-system/carbon-charts/commit/2da3404)) -- **configuration:** fix default baseBarChart options ([1a6dcef](https://github.com/carbon-design-system/carbon-charts/commit/1a6dcef)) +- **axis:** better support small time scales + ([8cfa595](https://github.com/carbon-design-system/carbon-charts/commit/8cfa595)) +- **axis:** fix lint issue + ([debeed9](https://github.com/carbon-design-system/carbon-charts/commit/debeed9)) +- **axis:** fix linting errors + ([f810d4a](https://github.com/carbon-design-system/carbon-charts/commit/f810d4a)) +- **axis:** remove confusing timeRangeToExtend property + ([0456e24](https://github.com/carbon-design-system/carbon-charts/commit/0456e24)) +- **config:** add additional property to control extension + ([2da3404](https://github.com/carbon-design-system/carbon-charts/commit/2da3404)) +- **configuration:** fix default baseBarChart options + ([1a6dcef](https://github.com/carbon-design-system/carbon-charts/commit/1a6dcef)) # [0.26.0](https://github.com/carbon-design-system/carbon-charts/compare/v0.25.0...v0.26.0) (2020-01-16) ### Features -- **core:** add event dispatches for mouseover, mousemove, click & mouseout for all graphs ([284012c](https://github.com/carbon-design-system/carbon-charts/commit/284012c)) +- **core:** add event dispatches for mouseover, mousemove, click & mouseout + for all graphs + ([284012c](https://github.com/carbon-design-system/carbon-charts/commit/284012c)) # [0.25.0](https://github.com/carbon-design-system/carbon-charts/compare/v0.24.5...v0.25.0) (2020-01-10) @@ -332,13 +348,16 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Bug Fixes -- **core:** fix to allow chart to toggle on and off using attribute/css properties ([77e26af](https://github.com/carbon-design-system/carbon-charts/commit/77e26af)) +- **core:** fix to allow chart to toggle on and off using attribute/css + properties + ([77e26af](https://github.com/carbon-design-system/carbon-charts/commit/77e26af)) ## [0.24.4](https://github.com/carbon-design-system/carbon-charts/compare/v0.24.3...v0.24.4) (2020-01-06) ### Bug Fixes -- **demos:** add IBM Plex Sans Condensed to the core demo site ([1761a36](https://github.com/carbon-design-system/carbon-charts/commit/1761a36)) +- **demos:** add IBM Plex Sans Condensed to the core demo site + ([1761a36](https://github.com/carbon-design-system/carbon-charts/commit/1761a36)) ## [0.24.3](https://github.com/carbon-design-system/carbon-charts/compare/v0.24.2...v0.24.3) (2019-12-19) @@ -356,13 +375,15 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Features -- **core, react, angular, vue:** add WAI-ARIA tags to elements ([1216ed6](https://github.com/carbon-design-system/carbon-charts/commit/1216ed6)) +- **core, react, angular, vue:** add WAI-ARIA tags to elements + ([1216ed6](https://github.com/carbon-design-system/carbon-charts/commit/1216ed6)) # [0.23.0](https://github.com/carbon-design-system/carbon-charts/compare/v0.22.4...v0.23.0) (2019-12-17) ### Features -- **core:** add spacer components ([4e5ab5c](https://github.com/carbon-design-system/carbon-charts/commit/4e5ab5c)) +- **core:** add spacer components + ([4e5ab5c](https://github.com/carbon-design-system/carbon-charts/commit/4e5ab5c)) ## [0.22.4](https://github.com/carbon-design-system/carbon-charts/compare/v0.22.3...v0.22.4) (2019-12-16) @@ -372,7 +393,8 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Bug Fixes -- **core:** update tooltip value formatter ([2a978d8](https://github.com/carbon-design-system/carbon-charts/commit/2a978d8)) +- **core:** update tooltip value formatter + ([2a978d8](https://github.com/carbon-design-system/carbon-charts/commit/2a978d8)) ## [0.22.2](https://github.com/carbon-design-system/carbon-charts/compare/v0.22.1...v0.22.2) (2019-12-16) @@ -386,67 +408,84 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Features -- **core, angular, react, vue:** Update chart width & height through options ([f050c35](https://github.com/carbon-design-system/carbon-charts/commit/f050c35)) +- **core, angular, react, vue:** Update chart width & height through options + ([f050c35](https://github.com/carbon-design-system/carbon-charts/commit/f050c35)) # [0.21.0](https://github.com/carbon-design-system/carbon-charts/compare/v0.20.1...v0.21.0) (2019-12-09) ### Features -- **core, angular, react, vue:** allow customizations to pie labels & the donut center number ([#427](https://github.com/carbon-design-system/carbon-charts/issues/427)) ([0446045](https://github.com/carbon-design-system/carbon-charts/commit/0446045)) +- **core, angular, react, vue:** allow customizations to pie labels & the + donut center number + ([#427](https://github.com/carbon-design-system/carbon-charts/issues/427)) + ([0446045](https://github.com/carbon-design-system/carbon-charts/commit/0446045)) ## [0.20.1](https://github.com/carbon-design-system/carbon-charts/compare/v0.20.0...v0.20.1) (2019-12-04) ### Bug Fixes -- **core:** loop also through non-display data to assign colors to datasets ([#394](https://github.com/carbon-design-system/carbon-charts/issues/394)) ([5ba8952](https://github.com/carbon-design-system/carbon-charts/commit/5ba8952)) +- **core:** loop also through non-display data to assign colors to datasets + ([#394](https://github.com/carbon-design-system/carbon-charts/issues/394)) + ([5ba8952](https://github.com/carbon-design-system/carbon-charts/commit/5ba8952)) # [0.20.0](https://github.com/carbon-design-system/carbon-charts/compare/v0.19.0...v0.20.0) (2019-12-02) ### Features -- **core:** add title truncation to tooltip ([bdd677c](https://github.com/carbon-design-system/carbon-charts/commit/bdd677c)) +- **core:** add title truncation to tooltip + ([bdd677c](https://github.com/carbon-design-system/carbon-charts/commit/bdd677c)) # [0.19.0](https://github.com/carbon-design-system/carbon-charts/compare/v0.18.0...v0.19.0) (2019-12-02) ### Features -- **core:** export interfaces and configurations ([df7f557](https://github.com/carbon-design-system/carbon-charts/commit/df7f557)) +- **core:** export interfaces and configurations + ([df7f557](https://github.com/carbon-design-system/carbon-charts/commit/df7f557)) # [0.18.0](https://github.com/carbon-design-system/carbon-charts/compare/v0.17.1...v0.18.0) (2019-12-02) ### Bug Fixes -- **bar:** fix lint errors ([0d04b04](https://github.com/carbon-design-system/carbon-charts/commit/0d04b04)) -- **tooltip:** rename defaultTooltip defaultHTML ([cf8f34e](https://github.com/carbon-design-system/carbon-charts/commit/cf8f34e)) +- **bar:** fix lint errors + ([0d04b04](https://github.com/carbon-design-system/carbon-charts/commit/0d04b04)) +- **tooltip:** rename defaultTooltip defaultHTML + ([cf8f34e](https://github.com/carbon-design-system/carbon-charts/commit/cf8f34e)) ### Features -- **bar:** pass default tooltip to customHTML tooltip ([b6f519b](https://github.com/carbon-design-system/carbon-charts/commit/b6f519b)) -- **tooltip:** for customHTML pass along the HTML tooltip ([7d1a026](https://github.com/carbon-design-system/carbon-charts/commit/7d1a026)) +- **bar:** pass default tooltip to customHTML tooltip + ([b6f519b](https://github.com/carbon-design-system/carbon-charts/commit/b6f519b)) +- **tooltip:** for customHTML pass along the HTML tooltip + ([7d1a026](https://github.com/carbon-design-system/carbon-charts/commit/7d1a026)) ## [0.17.1](https://github.com/carbon-design-system/carbon-charts/compare/v0.17.0...v0.17.1) (2019-11-29) ### Bug Fixes -- **core:** build optimizations ([fef77e5](https://github.com/carbon-design-system/carbon-charts/commit/fef77e5)) +- **core:** build optimizations + ([fef77e5](https://github.com/carbon-design-system/carbon-charts/commit/fef77e5)) # [0.17.0](https://github.com/carbon-design-system/carbon-charts/compare/v0.16.25...v0.17.0) (2019-11-29) ### Features -- **core:** date/time locale support + tick formatting ([bc02012](https://github.com/carbon-design-system/carbon-charts/commit/bc02012)) +- **core:** date/time locale support + tick formatting + ([bc02012](https://github.com/carbon-design-system/carbon-charts/commit/bc02012)) ## [0.16.25](https://github.com/carbon-design-system/carbon-charts/compare/v0.16.24...v0.16.25) (2019-10-29) ### Bug Fixes -- **core:** update type to scaleType and backgroundColors to fillColors ([3ca0a0f](https://github.com/carbon-design-system/carbon-charts/commit/3ca0a0f)) +- **core:** update type to scaleType and backgroundColors to fillColors + ([3ca0a0f](https://github.com/carbon-design-system/carbon-charts/commit/3ca0a0f)) ## [0.16.24](https://github.com/carbon-design-system/carbon-charts/compare/v0.16.23...v0.16.24) (2019-10-25) ### Bug Fixes -- **core, react, angular, vue:** default width & height to 100%, and call setOptions on option change ([db251b4](https://github.com/carbon-design-system/carbon-charts/commit/db251b4)) +- **core, react, angular, vue:** default width & height to 100%, and call + setOptions on option change + ([db251b4](https://github.com/carbon-design-system/carbon-charts/commit/db251b4)) ## [0.16.23](https://github.com/carbon-design-system/carbon-charts/compare/v0.16.22...v0.16.23) (2019-10-25) @@ -460,7 +499,8 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Bug Fixes -- **core:** update typescript version ([949379f](https://github.com/carbon-design-system/carbon-charts/commit/949379f)) +- **core:** update typescript version + ([949379f](https://github.com/carbon-design-system/carbon-charts/commit/949379f)) ## [0.16.20](https://github.com/carbon-design-system/carbon-charts/compare/v0.16.19...v0.16.20) (2019-10-24) @@ -470,7 +510,8 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Bug Fixes -- **tooltip:** fix to be multiline instead of multitooltip ([0f90325](https://github.com/carbon-design-system/carbon-charts/commit/0f90325)) +- **tooltip:** fix to be multiline instead of multitooltip + ([0f90325](https://github.com/carbon-design-system/carbon-charts/commit/0f90325)) ## [0.16.18](https://github.com/carbon-design-system/carbon-charts/compare/v0.16.17...v0.16.18) (2019-10-21) @@ -484,7 +525,8 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Bug Fixes -- custom global object in UMD bundle generated by webpack ([a4d1e54](https://github.com/carbon-design-system/carbon-charts/commit/a4d1e54)) +- custom global object in UMD bundle generated by webpack + ([a4d1e54](https://github.com/carbon-design-system/carbon-charts/commit/a4d1e54)) ## [0.16.15](https://github.com/carbon-design-system/carbon-charts/compare/v0.16.14...v0.16.15) (2019-10-09) @@ -538,13 +580,15 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Bug Fixes -- **angular:** Fix angular SSR issues ([86aa9d3](https://github.com/carbon-design-system/carbon-charts/commit/86aa9d3)) +- **angular:** Fix angular SSR issues + ([86aa9d3](https://github.com/carbon-design-system/carbon-charts/commit/86aa9d3)) ## [0.16.2](https://github.com/carbon-design-system/carbon-charts/compare/v0.16.1...v0.16.2) (2019-09-09) ### Bug Fixes -- **core, react:** fix react SSR & legend sizing issues ([abedba0](https://github.com/carbon-design-system/carbon-charts/commit/abedba0)) +- **core, react:** fix react SSR & legend sizing issues + ([abedba0](https://github.com/carbon-design-system/carbon-charts/commit/abedba0)) ## [0.16.1](https://github.com/carbon-design-system/carbon-charts/compare/v0.16.0...v0.16.1) (2019-09-06) @@ -554,8 +598,10 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Features -- **core:** Expand slice arcs in pie and donut on hover, and remove strokes ([ca5a467](https://github.com/carbon-design-system/carbon-charts/commit/ca5a467)) -- **core:** support width & maxWidth values for bars ([a2e7120](https://github.com/carbon-design-system/carbon-charts/commit/a2e7120)) +- **core:** Expand slice arcs in pie and donut on hover, and remove strokes + ([ca5a467](https://github.com/carbon-design-system/carbon-charts/commit/ca5a467)) +- **core:** support width & maxWidth values for bars + ([a2e7120](https://github.com/carbon-design-system/carbon-charts/commit/a2e7120)) ## [0.15.8](https://github.com/carbon-design-system/carbon-charts/compare/v0.15.7...v0.15.8) (2019-08-24) @@ -577,7 +623,8 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Bug Fixes -- **core:** fix resize grid backdrop ([8e1211e](https://github.com/carbon-design-system/carbon-charts/commit/8e1211e)) +- **core:** fix resize grid backdrop + ([8e1211e](https://github.com/carbon-design-system/carbon-charts/commit/8e1211e)) ## [0.15.3](https://github.com/carbon-design-system/carbon-charts/compare/v0.15.2...v0.15.3) (2019-08-16) @@ -587,19 +634,22 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Bug Fixes -- **core:** fix for better backdrop resizing on axis grids ([6a12a60](https://github.com/carbon-design-system/carbon-charts/commit/6a12a60)) +- **core:** fix for better backdrop resizing on axis grids + ([6a12a60](https://github.com/carbon-design-system/carbon-charts/commit/6a12a60)) ## [0.15.1](https://github.com/carbon-design-system/carbon-charts/compare/v0.15.0...v0.15.1) (2019-07-17) ### Bug Fixes -- **core:** backdrop resize with chart ([bbc288d](https://github.com/carbon-design-system/carbon-charts/commit/bbc288d)) +- **core:** backdrop resize with chart + ([bbc288d](https://github.com/carbon-design-system/carbon-charts/commit/bbc288d)) # [0.15.0](https://github.com/carbon-design-system/carbon-charts/compare/v0.14.1...v0.15.0) (2019-07-17) ### Features -- **core:** adding carbon themes ([a31fbcf](https://github.com/carbon-design-system/carbon-charts/commit/a31fbcf)) +- **core:** adding carbon themes + ([a31fbcf](https://github.com/carbon-design-system/carbon-charts/commit/a31fbcf)) ## [0.14.1](https://github.com/carbon-design-system/carbon-charts/compare/v0.14.0...v0.14.1) (2019-07-11) @@ -613,7 +663,8 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Features -- **core:** addition of titles within svg chart ([56380bb](https://github.com/carbon-design-system/carbon-charts/commit/56380bb)) +- **core:** addition of titles within svg chart + ([56380bb](https://github.com/carbon-design-system/carbon-charts/commit/56380bb)) ## [0.12.5](https://github.com/carbon-design-system/carbon-charts/compare/v0.12.4...v0.12.5) (2019-07-04) @@ -623,7 +674,9 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Bug Fixes -- **react core:** change main bundle to umd in core, and update imports in react ([df9c7c3](https://github.com/carbon-design-system/carbon-charts/commit/df9c7c3)) +- **react core:** change main bundle to umd in core, and update imports in + react + ([df9c7c3](https://github.com/carbon-design-system/carbon-charts/commit/df9c7c3)) ## [0.12.3](https://github.com/carbon-design-system/carbon-charts/compare/v0.12.2...v0.12.3) (2019-06-26) @@ -641,26 +694,32 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Features -- **core:** Colors, themes & more design updates ([#261](https://github.com/carbon-design-system/carbon-charts/issues/261)) ([b0b9070](https://github.com/carbon-design-system/carbon-charts/commit/b0b9070)) -- **feat(core:** Color palettes): ([edcf601](https://github.com/carbon-design-system/carbon-charts/commit/edcf601)) +- **core:** Colors, themes & more design updates + ([#261](https://github.com/carbon-design-system/carbon-charts/issues/261)) + ([b0b9070](https://github.com/carbon-design-system/carbon-charts/commit/b0b9070)) +- **feat(core:** Color palettes): + ([edcf601](https://github.com/carbon-design-system/carbon-charts/commit/edcf601)) ## [0.11.15](https://github.com/carbon-design-system/carbon-charts/compare/v0.11.14...v0.11.15) (2019-05-07) ### Bug Fixes -- **core:** Fix tooltip positioning ([dd17048](https://github.com/carbon-design-system/carbon-charts/commit/dd17048)) +- **core:** Fix tooltip positioning + ([dd17048](https://github.com/carbon-design-system/carbon-charts/commit/dd17048)) ## [0.11.14](https://github.com/carbon-design-system/carbon-charts/compare/v0.11.12...v0.11.14) (2019-05-06) ### Bug Fixes -- **core:** Show empty state for when there is no data ([b5db127](https://github.com/carbon-design-system/carbon-charts/commit/b5db127)) +- **core:** Show empty state for when there is no data + ([b5db127](https://github.com/carbon-design-system/carbon-charts/commit/b5db127)) ## [0.11.13](https://github.com/carbon-design-system/carbon-charts/compare/v0.11.12...v0.11.13) (2019-04-30) ### Bug Fixes -- **core:** Show empty state for when there is no data ([b5db127](https://github.com/carbon-design-system/carbon-charts/commit/b5db127)) +- **core:** Show empty state for when there is no data + ([b5db127](https://github.com/carbon-design-system/carbon-charts/commit/b5db127)) ## [0.11.12](https://github.com/carbon-design-system/carbon-charts/compare/v0.11.11...v0.11.12) (2019-04-22) @@ -682,25 +741,34 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Bug Fixes -- **core:** add babel-polyfill as a hard dependency ([#230](https://github.com/carbon-design-system/carbon-charts/issues/230)) ([d3e8c0c](https://github.com/carbon-design-system/carbon-charts/commit/d3e8c0c)) +- **core:** add babel-polyfill as a hard dependency + ([#230](https://github.com/carbon-design-system/carbon-charts/issues/230)) + ([d3e8c0c](https://github.com/carbon-design-system/carbon-charts/commit/d3e8c0c)) ## [0.11.7](https://github.com/carbon-design-system/carbon-charts/compare/v0.11.6...v0.11.7) (2019-03-26) ### Bug Fixes -- **core:** remove suffixes to use regular module resolution, and force publish all packages with every release ([#229](https://github.com/carbon-design-system/carbon-charts/issues/229)) ([2e33ca6](https://github.com/carbon-design-system/carbon-charts/commit/2e33ca6)) +- **core:** remove suffixes to use regular module resolution, and force + publish all packages with every release + ([#229](https://github.com/carbon-design-system/carbon-charts/issues/229)) + ([2e33ca6](https://github.com/carbon-design-system/carbon-charts/commit/2e33ca6)) ## [0.11.6](https://github.com/carbon-design-system/carbon-charts/compare/v0.11.5...v0.11.6) (2019-03-26) ### Bug Fixes -- **core:** export patterns as strings of svgs ([#227](https://github.com/carbon-design-system/carbon-charts/issues/227)) ([14391ae](https://github.com/carbon-design-system/carbon-charts/commit/14391ae)) +- **core:** export patterns as strings of svgs + ([#227](https://github.com/carbon-design-system/carbon-charts/issues/227)) + ([14391ae](https://github.com/carbon-design-system/carbon-charts/commit/14391ae)) ## [0.11.5](https://github.com/carbon-design-system/carbon-charts/compare/v0.11.4...v0.11.5) (2019-03-26) ### Bug Fixes -- **build:** refactor deploy and update package.jsons ([#223](https://github.com/carbon-design-system/carbon-charts/issues/223)) ([fb512cb](https://github.com/carbon-design-system/carbon-charts/commit/fb512cb)) +- **build:** refactor deploy and update package.jsons + ([#223](https://github.com/carbon-design-system/carbon-charts/issues/223)) + ([fb512cb](https://github.com/carbon-design-system/carbon-charts/commit/fb512cb)) ## [0.11.4](https://github.com/carbon-design-system/carbon-charts/compare/v0.11.3...v0.11.4) (2019-03-25) @@ -710,7 +778,8 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Features -- **core:** specify config as interfaces ([e474fb6](https://github.com/carbon-design-system/carbon-charts/commit/e474fb6)) +- **core:** specify config as interfaces + ([e474fb6](https://github.com/carbon-design-system/carbon-charts/commit/e474fb6)) ## [0.10.5](https://github.com/carbon-design-system/carbon-charts/compare/v0.10.4...v0.10.5) (2019-03-12) @@ -720,14 +789,21 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Bug Fixes -- **core:** remove updateSVG() ([38f7e83](https://github.com/carbon-design-system/carbon-charts/commit/38f7e83)), closes [#185](https://github.com/carbon-design-system/carbon-charts/issues/185) +- **core:** remove updateSVG() + ([38f7e83](https://github.com/carbon-design-system/carbon-charts/commit/38f7e83)), + closes + [#185](https://github.com/carbon-design-system/carbon-charts/issues/185) ## [0.10.2](https://github.com/carbon-design-system/carbon-charts/compare/v0.10.1...v0.10.2) (2019-03-06) ### Bug Fixes -- **core:** Enforce text alignment of legend popup in the styles ([#203](https://github.com/carbon-design-system/carbon-charts/issues/203)) ([6a4fe1e](https://github.com/carbon-design-system/carbon-charts/commit/6a4fe1e)) -- **core:** Fix loss of letters in labels in wrapTicks() ([#202](https://github.com/carbon-design-system/carbon-charts/issues/202)) ([8635e7b](https://github.com/carbon-design-system/carbon-charts/commit/8635e7b)) +- **core:** Enforce text alignment of legend popup in the styles + ([#203](https://github.com/carbon-design-system/carbon-charts/issues/203)) + ([6a4fe1e](https://github.com/carbon-design-system/carbon-charts/commit/6a4fe1e)) +- **core:** Fix loss of letters in labels in wrapTicks() + ([#202](https://github.com/carbon-design-system/carbon-charts/issues/202)) + ([8635e7b](https://github.com/carbon-design-system/carbon-charts/commit/8635e7b)) ## [0.10.1](https://github.com/carbon-design-system/carbon-charts/compare/v0.10.0...v0.10.1) (2019-02-28) @@ -737,7 +813,10 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Features -- **\$core:** Adds getStrokeColor and getFillColor options ([e1766d3](https://github.com/carbon-design-system/carbon-charts/commit/e1766d3)), closes [#136](https://github.com/carbon-design-system/carbon-charts/issues/136) +- **\$core:** Adds getStrokeColor and getFillColor options + ([e1766d3](https://github.com/carbon-design-system/carbon-charts/commit/e1766d3)), + closes + [#136](https://github.com/carbon-design-system/carbon-charts/issues/136) ## [0.9.7](https://github.com/carbon-design-system/carbon-charts/compare/v0.9.6...v0.9.7) (2019-02-22) @@ -747,75 +826,96 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Bug Fixes -- **bar:** add maxWidth and other bar fixes ([3866d86](https://github.com/carbon-design-system/carbon-charts/commit/3866d86)) +- **bar:** add maxWidth and other bar fixes + ([3866d86](https://github.com/carbon-design-system/carbon-charts/commit/3866d86)) ## [0.9.5](https://github.com/carbon-design-system/carbon-charts/compare/v0.9.4...v0.9.5) (2019-02-20) ### Bug Fixes -- **\$core:** Fixes opacity transitions not completing when data is updated. Ensures use SVG vs CSS op ([f6b245e](https://github.com/carbon-design-system/carbon-charts/commit/f6b245e)) +- **\$core:** Fixes opacity transitions not completing when data is updated. + Ensures use SVG vs CSS op + ([f6b245e](https://github.com/carbon-design-system/carbon-charts/commit/f6b245e)) ## [0.9.4](https://github.com/carbon-design-system/carbon-charts/compare/v0.9.3...v0.9.4) (2019-02-16) ### Bug Fixes -- **\$browser:** Fix duplication of titles during title resize ([4698efd](https://github.com/carbon-design-system/carbon-charts/commit/4698efd)) +- **\$browser:** Fix duplication of titles during title resize + ([4698efd](https://github.com/carbon-design-system/carbon-charts/commit/4698efd)) ## [0.9.3](https://github.com/carbon-design-system/carbon-charts/compare/v0.9.2...v0.9.3) (2019-02-15) ### Bug Fixes -- **core:** Fix NPM vulnerabilities ([73ef611](https://github.com/carbon-design-system/carbon-charts/commit/73ef611)) +- **core:** Fix NPM vulnerabilities + ([73ef611](https://github.com/carbon-design-system/carbon-charts/commit/73ef611)) ## [0.9.2](https://github.com/carbon-design-system/carbon-charts/compare/v0.9.1...v0.9.2) (2019-02-15) ### Bug Fixes -- **core:** Allow custom circle size for line chart ([5fb93bd](https://github.com/carbon-design-system/carbon-charts/commit/5fb93bd)) +- **core:** Allow custom circle size for line chart + ([5fb93bd](https://github.com/carbon-design-system/carbon-charts/commit/5fb93bd)) ## [0.9.1](https://github.com/carbon-design-system/carbon-charts/compare/v0.9.0...v0.9.1) (2019-02-07) ### Bug Fixes -- **core:** Allow the usage of different size variants of tooltip ([4f6aa1d](https://github.com/carbon-design-system/carbon-charts/commit/4f6aa1d)) +- **core:** Allow the usage of different size variants of tooltip + ([4f6aa1d](https://github.com/carbon-design-system/carbon-charts/commit/4f6aa1d)) # [0.9.0](https://github.com/carbon-design-system/carbon-charts/compare/v0.8.6...v0.9.0) (2019-01-28) ### Features -- **CORE:** ability to customize donut label & number ([07014cf](https://github.com/carbon-design-system/carbon-charts/commit/07014cf)) +- **CORE:** ability to customize donut label & number + ([07014cf](https://github.com/carbon-design-system/carbon-charts/commit/07014cf)) ## [0.8.6](https://github.com/carbon-design-system/carbon-charts/compare/v0.8.5...v0.8.6) (2019-01-18) ### Bug Fixes -- **\$browser:** Fixes the issue with pie labels not lining up on smaller sizes. ([154467f](https://github.com/carbon-design-system/carbon-charts/commit/154467f)), closes [#151](https://github.com/carbon-design-system/carbon-charts/issues/151) -- **\$browser:** Use dynamic step value for margin instead of fixed value. ([1c96d7a](https://github.com/carbon-design-system/carbon-charts/commit/1c96d7a)) -- **core:** Fix interference of thresholds and bar chart elements ([a69dc15](https://github.com/carbon-design-system/carbon-charts/commit/a69dc15)) +- **\$browser:** Fixes the issue with pie labels not lining up on smaller + sizes. + ([154467f](https://github.com/carbon-design-system/carbon-charts/commit/154467f)), + closes + [#151](https://github.com/carbon-design-system/carbon-charts/issues/151) +- **\$browser:** Use dynamic step value for margin instead of fixed value. + ([1c96d7a](https://github.com/carbon-design-system/carbon-charts/commit/1c96d7a)) +- **core:** Fix interference of thresholds and bar chart elements + ([a69dc15](https://github.com/carbon-design-system/carbon-charts/commit/a69dc15)) ## [0.8.5](https://github.com/carbon-design-system/carbon-charts/compare/v0.8.4...v0.8.5) (2019-01-17) ### Bug Fixes -- **\$browser:** Fixes the issue with pie labels not lining up on smaller sizes. ([54e2227](https://github.com/carbon-design-system/carbon-charts/commit/54e2227)), closes [#151](https://github.com/carbon-design-system/carbon-charts/issues/151) +- **\$browser:** Fixes the issue with pie labels not lining up on smaller + sizes. + ([54e2227](https://github.com/carbon-design-system/carbon-charts/commit/54e2227)), + closes + [#151](https://github.com/carbon-design-system/carbon-charts/issues/151) ## [0.8.4](https://github.com/carbon-design-system/carbon-charts/compare/v0.8.3...v0.8.4) (2019-01-17) ### Bug Fixes -- **core:** Fix interference of thresholds and bar chart elements ([67ff065](https://github.com/carbon-design-system/carbon-charts/commit/67ff065)) +- **core:** Fix interference of thresholds and bar chart elements + ([67ff065](https://github.com/carbon-design-system/carbon-charts/commit/67ff065)) ## [0.8.3](https://github.com/carbon-design-system/carbon-charts/compare/v0.8.2...v0.8.3) (2019-01-16) ### Bug Fixes -- **core:** Fix tooltip positioning and clean up styling ([6de0665](https://github.com/carbon-design-system/carbon-charts/commit/6de0665)) +- **core:** Fix tooltip positioning and clean up styling + ([6de0665](https://github.com/carbon-design-system/carbon-charts/commit/6de0665)) ## [0.8.2](https://github.com/carbon-design-system/carbon-charts/compare/v0.8.1...v0.8.2) (2019-01-14) ### Bug Fixes -- **core demo:** Fix experimental link issue ([d9d660a](https://github.com/carbon-design-system/carbon-charts/commit/d9d660a)) +- **core demo:** Fix experimental link issue + ([d9d660a](https://github.com/carbon-design-system/carbon-charts/commit/d9d660a)) ## [0.8.1](https://github.com/carbon-design-system/carbon-charts/compare/v0.8.0...v0.8.1) (2019-01-09) @@ -825,13 +925,17 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Features -- **\$core:** adds support for tension, beta, alpha in curves ([09437dc](https://github.com/carbon-design-system/carbon-charts/commit/09437dc)), closes [#39](https://github.com/carbon-design-system/carbon-charts/issues/39) +- **\$core:** adds support for tension, beta, alpha in curves + ([09437dc](https://github.com/carbon-design-system/carbon-charts/commit/09437dc)), + closes + [#39](https://github.com/carbon-design-system/carbon-charts/issues/39) ## [0.7.16](https://github.com/carbon-design-system/carbon-charts/compare/v0.7.15...v0.7.16) (2019-01-03) ### Bug Fixes -- **core:** Remove extension of addLegend in PieChart ([c66b633](https://github.com/carbon-design-system/carbon-charts/commit/c66b633)) +- **core:** Remove extension of addLegend in PieChart + ([c66b633](https://github.com/carbon-design-system/carbon-charts/commit/c66b633)) ## [0.7.14](https://github.com/carbon-design-system/carbon-charts/compare/v0.7.13...v0.7.14) (2019-01-03) @@ -845,19 +949,25 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Bug Fixes -- **react:** Fix react wrappers resizing with animation ([4219f33](https://github.com/carbon-design-system/carbon-charts/commit/4219f33)) +- **react:** Fix react wrappers resizing with animation + ([4219f33](https://github.com/carbon-design-system/carbon-charts/commit/4219f33)) ## [0.7.9](https://github.com/carbon-design-system/carbon-charts/compare/v0.7.8...v0.7.9) (2018-11-22) ### Bug Fixes -- **core:** Use a minimum size for all charts, and use resizeObserver rather than requestAnimationFra ([462c2d6](https://github.com/carbon-design-system/carbon-charts/commit/462c2d6)) +- **core:** Use a minimum size for all charts, and use resizeObserver rather + than requestAnimationFra + ([462c2d6](https://github.com/carbon-design-system/carbon-charts/commit/462c2d6)) ## [0.7.8](https://github.com/carbon-design-system/carbon-charts/compare/v0.7.7...v0.7.8) (2018-11-22) ### Bug Fixes -- **core:** Remove and update addDataPointEventListener ([f40f775](https://github.com/carbon-design-system/carbon-charts/commit/f40f775)), closes [#97](https://github.com/carbon-design-system/carbon-charts/issues/97) +- **core:** Remove and update addDataPointEventListener + ([f40f775](https://github.com/carbon-design-system/carbon-charts/commit/f40f775)), + closes + [#97](https://github.com/carbon-design-system/carbon-charts/issues/97) ## [0.7.5](https://github.com/carbon-design-system/carbon-charts/compare/v0.7.4...v0.7.5) (2018-11-20) @@ -867,7 +977,10 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Bug Fixes -- **packages/core/src/line-chart.ts:** Fix tooltips bug [#89](https://github.com/carbon-design-system/carbon-charts/issues/89): Fix imports and addDataPointEventListene ([5a63f94](https://github.com/carbon-design-system/carbon-charts/commit/5a63f94)) +- **packages/core/src/line-chart.ts:** Fix tooltips bug + [#89](https://github.com/carbon-design-system/carbon-charts/issues/89): Fix + imports and addDataPointEventListene + ([5a63f94](https://github.com/carbon-design-system/carbon-charts/commit/5a63f94)) ## [0.7.3](https://github.com/carbon-design-system/carbon-charts/compare/v0.7.2...v0.7.3) (2018-11-13) @@ -877,41 +990,52 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Bug Fixes -- **core:** Fixed label colours on donut charts ([5e40ef6](https://github.com/carbon-design-system/carbon-charts/commit/5e40ef6)) +- **core:** Fixed label colours on donut charts + ([5e40ef6](https://github.com/carbon-design-system/carbon-charts/commit/5e40ef6)) ## [0.7.1](https://github.com/carbon-design-system/carbon-charts/compare/v0.7.0...v0.7.1) (2018-11-12) ### Bug Fixes -- **core:** Refactor thresholds to support a range of values, closes [#85](https://github.com/carbon-design-system/carbon-charts/issues/85) ([50b44c0](https://github.com/carbon-design-system/carbon-charts/commit/50b44c0)) +- **core:** Refactor thresholds to support a range of values, closes + [#85](https://github.com/carbon-design-system/carbon-charts/issues/85) + ([50b44c0](https://github.com/carbon-design-system/carbon-charts/commit/50b44c0)) # [0.7.0](https://github.com/carbon-design-system/carbon-charts/compare/v0.6.2...v0.7.0) (2018-11-12) ### Features -- **core:** Automatic calculation of DonutCenter value, closes [#83](https://github.com/carbon-design-system/carbon-charts/issues/83) ([d20e883](https://github.com/carbon-design-system/carbon-charts/commit/d20e883)) +- **core:** Automatic calculation of DonutCenter value, closes + [#83](https://github.com/carbon-design-system/carbon-charts/issues/83) + ([d20e883](https://github.com/carbon-design-system/carbon-charts/commit/d20e883)) ## [0.6.2](https://github.com/carbon-design-system/carbon-charts/compare/v0.6.1...v0.6.2) (2018-11-12) ### Bug Fixes -- **\$core:** Remove hover effect and pointer on non-clickable legends ([dc9a2f2](https://github.com/carbon-design-system/carbon-charts/commit/dc9a2f2)), closes [#71](https://github.com/carbon-design-system/carbon-charts/issues/71) +- **\$core:** Remove hover effect and pointer on non-clickable legends + ([dc9a2f2](https://github.com/carbon-design-system/carbon-charts/commit/dc9a2f2)), + closes + [#71](https://github.com/carbon-design-system/carbon-charts/issues/71) ## [0.6.1](https://github.com/carbon-design-system/carbon-charts/compare/v0.6.0...v0.6.1) (2018-11-09) ### Bug Fixes -- **angular:** Fix babel-polyfill multiple instances issue ([4a2f165](https://github.com/carbon-design-system/carbon-charts/commit/4a2f165)) +- **angular:** Fix babel-polyfill multiple instances issue + ([4a2f165](https://github.com/carbon-design-system/carbon-charts/commit/4a2f165)) # [0.6.0](https://github.com/carbon-design-system/carbon-charts/compare/v0.5.4...v0.6.0) (2018-11-01) ### Bug Fixes -- **core:** Resize thresholds, and update threshold theme colors ([3d86841](https://github.com/carbon-design-system/carbon-charts/commit/3d86841)) +- **core:** Resize thresholds, and update threshold theme colors + ([3d86841](https://github.com/carbon-design-system/carbon-charts/commit/3d86841)) ### Features -- **core:** changed threshold config format, code refactor ([d931a82](https://github.com/carbon-design-system/carbon-charts/commit/d931a82)) +- **core:** changed threshold config format, code refactor + ([d931a82](https://github.com/carbon-design-system/carbon-charts/commit/d931a82)) @@ -943,12 +1067,16 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Bug Fixes -- **core:** legend updates in pie & donut should respect legend filters ([203c7e6](https://github.com/carbon-design-system/carbon-charts/commit/203c7e6)) -- **core:** use correct default colors, and replace loading bee with carbon loading spinner ([80ff9bd](https://github.com/carbon-design-system/carbon-charts/commit/80ff9bd)) +- **core:** legend updates in pie & donut should respect legend filters + ([203c7e6](https://github.com/carbon-design-system/carbon-charts/commit/203c7e6)) +- **core:** use correct default colors, and replace loading bee with carbon + loading spinner + ([80ff9bd](https://github.com/carbon-design-system/carbon-charts/commit/80ff9bd)) ### Features -- **core:** first attempt at combo-chart ([6613160](https://github.com/carbon-design-system/carbon-charts/commit/6613160)) +- **core:** first attempt at combo-chart + ([6613160](https://github.com/carbon-design-system/carbon-charts/commit/6613160)) @@ -962,7 +1090,8 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Bug Fixes -- **core angular:** IE11 Support ([b0dd2b5](https://github.com/carbon-design-system/carbon-charts/commit/b0dd2b5)) +- **core angular:** IE11 Support + ([b0dd2b5](https://github.com/carbon-design-system/carbon-charts/commit/b0dd2b5)) @@ -970,8 +1099,10 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Bug Fixes -- **core angular:** Remove demo folders from published packages ([5e3c556](https://github.com/carbon-design-system/carbon-charts/commit/5e3c556)) -- **core angular:** Remove demos & add dist in packages ([94bb9f4](https://github.com/carbon-design-system/carbon-charts/commit/94bb9f4)) +- **core angular:** Remove demo folders from published packages + ([5e3c556](https://github.com/carbon-design-system/carbon-charts/commit/5e3c556)) +- **core angular:** Remove demos & add dist in packages + ([94bb9f4](https://github.com/carbon-design-system/carbon-charts/commit/94bb9f4)) @@ -979,7 +1110,8 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Features -- **core angular react:** Resolve DAP violations ([86f6e05](https://github.com/carbon-design-system/carbon-charts/commit/86f6e05)) +- **core angular react:** Resolve DAP violations + ([86f6e05](https://github.com/carbon-design-system/carbon-charts/commit/86f6e05)) @@ -987,7 +1119,8 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Features -- **core angular:** trigger minor release on Travis ([1c476b2](https://github.com/carbon-design-system/carbon-charts/commit/1c476b2)) +- **core angular:** trigger minor release on Travis + ([1c476b2](https://github.com/carbon-design-system/carbon-charts/commit/1c476b2)) @@ -995,7 +1128,8 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Features -- **core angular react:** trigger a minor release in Travis ([2995cfa](https://github.com/carbon-design-system/carbon-charts/commit/2995cfa)) +- **core angular react:** trigger a minor release in Travis + ([2995cfa](https://github.com/carbon-design-system/carbon-charts/commit/2995cfa)) @@ -1003,15 +1137,27 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Bug Fixes -- **core angular react:** fix tooltip styling ([80b36f5](https://github.com/carbon-design-system/carbon-charts/commit/80b36f5)) -- **peretz-icons:** show peretz-icons instead of raw SVG for tooltip close button ([19a54d4](https://github.com/carbon-design-system/carbon-charts/commit/19a54d4)) -- **scope angular react:** use a more specific class name for chart tooltips ([4cbe680](https://github.com/carbon-design-system/carbon-charts/commit/4cbe680)) +- **core angular react:** fix tooltip styling + ([80b36f5](https://github.com/carbon-design-system/carbon-charts/commit/80b36f5)) +- **peretz-icons:** show peretz-icons instead of raw SVG for tooltip close + button + ([19a54d4](https://github.com/carbon-design-system/carbon-charts/commit/19a54d4)) +- **scope angular react:** use a more specific class name for chart tooltips + ([4cbe680](https://github.com/carbon-design-system/carbon-charts/commit/4cbe680)) ### Features -- **core angular react:** support negative y-values ([cfa941d](https://github.com/carbon-design-system/carbon-charts/commit/cfa941d)) -- **core react angular:** carbon styling ([5064f63](https://github.com/carbon-design-system/carbon-charts/commit/5064f63)) -- **react wrappers storybook:** full react wrappers ([4a456ee](https://github.com/carbon-design-system/carbon-charts/commit/4a456ee)), closes [#117](https://github.com/carbon-design-system/carbon-charts/issues/117) [#115](https://github.com/carbon-design-system/carbon-charts/issues/115) [#120](https://github.com/carbon-design-system/carbon-charts/issues/120) [#121](https://github.com/carbon-design-system/carbon-charts/issues/121) +- **core angular react:** support negative y-values + ([cfa941d](https://github.com/carbon-design-system/carbon-charts/commit/cfa941d)) +- **core react angular:** carbon styling + ([5064f63](https://github.com/carbon-design-system/carbon-charts/commit/5064f63)) +- **react wrappers storybook:** full react wrappers + ([4a456ee](https://github.com/carbon-design-system/carbon-charts/commit/4a456ee)), + closes + [#117](https://github.com/carbon-design-system/carbon-charts/issues/117) + [#115](https://github.com/carbon-design-system/carbon-charts/issues/115) + [#120](https://github.com/carbon-design-system/carbon-charts/issues/120) + [#121](https://github.com/carbon-design-system/carbon-charts/issues/121) # Change Log diff --git a/packages/core/README.md b/packages/core/README.md index e252ffca6e..a98e328c05 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -17,26 +17,36 @@ instead: yarn add @carbon/charts d3 ``` -**Note:** you'd also need to install `carbon-components` if you're not using a bundled version of the library. +**Note:** you'd also need to install `carbon-components` if you're not using a +bundled version of the library. ## Step-by-step instructions -Read [here](https://carbon-design-system.github.io/carbon-charts/?path=/story/tutorials-getting-started--vanilla) +Read +[here](https://carbon-design-system.github.io/carbon-charts/?path=/story/tutorials-getting-started--vanilla) ## Codesandbox examples [Sample use cases can be seen here](https://carbon-design-system.github.io/carbon-charts). -**When opening the link above**, click on the **Edit on Codesandbox** button for each demo to see an isolated project showing you how to reproduce the demo. +**When opening the link above**, click on the **Edit on Codesandbox** button for +each demo to see an isolated project showing you how to reproduce the demo. ## Charting data & options -Although we will definitely introduce new models in the future as we start shipping new components such as maps, Data and options follow the same model in all charts, with minor exceptions and differences in specific components. +Although we will definitely introduce new models in the future as we start +shipping new components such as maps, Data and options follow the same model in +all charts, with minor exceptions and differences in specific components. -For instance in the case of a donut chart you're able to pass in an additional field called `center` in your options configuring the donut center. +For instance in the case of a donut chart you're able to pass in an additional +field called `center` in your options configuring the donut center. -For instructions on using the **tabular data format**, see [here](https://carbon-design-system.github.io/carbon-charts/?path=/story/tutorials--tabular-data-format) +For instructions on using the **tabular data format**, see +[here](https://carbon-design-system.github.io/carbon-charts/?path=/story/tutorials--tabular-data-format) -There are also additional options available depending on the chart type being used, [see our demo examples here](https://github.com/carbon-design-system/carbon-charts/tree/master/packages/core/demo/data). +There are also additional options available depending on the chart type being +used, +[see our demo examples here](https://github.com/carbon-design-system/carbon-charts/tree/master/packages/core/demo/data). -Customizable options (specific to chart type) can be found [here](https://carbon-design-system.github.io/carbon-charts/documentation/modules/_interfaces_charts_.html) +Customizable options (specific to chart type) can be found +[here](https://carbon-design-system.github.io/carbon-charts/documentation/modules/_interfaces_charts_.html) diff --git a/packages/core/demo/create-codesandbox.ts b/packages/core/demo/create-codesandbox.ts index 57e89f1abf..cb0e82ed30 100644 --- a/packages/core/demo/create-codesandbox.ts +++ b/packages/core/demo/create-codesandbox.ts @@ -54,22 +54,22 @@ new ${chartComponent}(chartHolder, { const packageJson = { scripts: { start: "parcel index.html --open", - build: "parcel build index.html", + build: "parcel build index.html" }, dependencies: { "@carbon/charts": libraryVersion, "carbon-components": carbonComponentsVersion, - d3: "5.9.2", + d3: "5.9.2" }, devDependencies: { - "parcel-bundler": "^1.6.1", - }, + "parcel-bundler": "^1.6.1" + } }; return { "index.html": indexHtml, "src/index.js": indexJs, - "package.json": packageJson, + "package.json": packageJson }; }; @@ -115,15 +115,15 @@ ReactDOM.render(, document.getElementById("root")); react: "16.12.0", "react-dom": "16.12.0", "react-scripts": "3.0.1", - "carbon-components": carbonComponentsVersion, - }, + "carbon-components": carbonComponentsVersion + } }; return { "src/index.html": indexHtml, "src/index.js": indexJs, "src/ibm-plex-font.css": ibmPlexFontCSS, - "package.json": packageJson, + "package.json": packageJson }; }; @@ -216,8 +216,8 @@ platformBrowserDynamic() "core-js": "3.6.0", d3: "5.15.0", rxjs: "6.5.3", - "zone.js": "0.10.2", - }, + "zone.js": "0.10.2" + } }, null, "\t" @@ -231,7 +231,7 @@ platformBrowserDynamic() "src/app/ibm-plex-font.css": ibmPlexFontCSS, "src/app/app.module.ts": appModule, ".angular-cli.json": angularCliJson, - "package.json": packageJson, + "package.json": packageJson }; }; @@ -297,8 +297,8 @@ new Vue({ "@vue/cli-plugin-babel": "4.1.1", "carbon-components": carbonComponentsVersion, d3: "5.15.0", - vue: "^2.6.11", - }, + vue: "^2.6.11" + } }, null, "\t\t" @@ -309,7 +309,7 @@ new Vue({ "src/ibm-plex-font.css": ibmPlexFontCSS, "src/App.vue": appVue, "src/main.js": mainJs, - "package.json": packageJson, + "package.json": packageJson }; }; @@ -358,7 +358,7 @@ export default app; autobuild: "rollup -c -w", dev: "run-p start:dev autobuild", start: "sirv public", - "start:dev": "sirv public --dev", + "start:dev": "sirv public --dev" }, devDependencies: { "npm-run-all": "^4.1.5", @@ -367,15 +367,15 @@ export default app; "rollup-plugin-node-resolve": "^4.2.3", "rollup-plugin-svelte": "^5.0.3", "rollup-plugin-terser": "^4.0.4", - "sirv-cli": "^0.3.1", + "sirv-cli": "^0.3.1" }, dependencies: { "@carbon/charts": libraryVersion, "@carbon/charts-svelte": libraryVersion, "carbon-components": carbonComponentsVersion, d3: "5.12.0", - svelte: "3.20.x", - }, + svelte: "3.20.x" + } }; const rollup = `import svelte from "rollup-plugin-svelte"; @@ -413,6 +413,6 @@ export default { "App.svelte": App, "index.js": indexJs, "package.json": packageJson, - "rollup.config.js": rollup, + "rollup.config.js": rollup }; }; diff --git a/packages/core/demo/data/bar.ts b/packages/core/demo/data/bar.ts index 7e647f5c77..9ef22a03de 100644 --- a/packages/core/demo/data/bar.ts +++ b/packages/core/demo/data/bar.ts @@ -20,20 +20,20 @@ export const groupedBarData = [ { group: "Dataset 4", key: "More", value: 21313 }, { group: "Dataset 4", key: "Sold", value: 64353 }, { group: "Dataset 4", key: "Restocking", value: 24134 }, - { group: "Dataset 4", key: "Misc", value: 24134 }, + { group: "Dataset 4", key: "Misc", value: 24134 } ]; export const groupedBarOptions = { title: "Grouped bar (discrete)", axes: { left: { - mapsTo: "value", + mapsTo: "value" }, bottom: { scaleType: "labels", - mapsTo: "key", - }, - }, + mapsTo: "key" + } + } }; // Horizontal Grouped @@ -44,12 +44,12 @@ export const groupedHorizontalBarOptions = { axes: { left: { scaleType: "labels", - mapsTo: "key", + mapsTo: "key" }, bottom: { - mapsTo: "value", - }, - }, + mapsTo: "value" + } + } }; // Simple bar @@ -58,41 +58,57 @@ export const simpleBarData = [ { group: "More", value: 29123 }, { group: "Sold", value: 35213 }, { group: "Restocking", value: 51213 }, - { group: "Misc", value: 16932 }, + { group: "Misc", value: 16932 } ]; export const simpleBarOptions = { title: "Simple bar (discrete)", axes: { left: { - mapsTo: "value", + mapsTo: "value" }, bottom: { mapsTo: "group", - scaleType: "labels", - }, - }, + scaleType: "labels" + } + } }; // Simple bar with long labels export const simpleBarLongLabelData = [ - { group: "6591DA8668C339B1B39297C61091E320C35391AB7AFC15B469F96B8A2DD0C231", value: 65000 }, - { group: "347FEDE2F7403759069E5F84B65B49D2467D8914B5184738699259AA310EB0F9", value: 29123 }, - { group: "232D788298773BB389DBB8FCE44D3FB4E878879BE7AFB0B303BCE0D56EBB92E2", value: 35213 }, - { group: "58B01AADFA87E5547A218B3C6CE3AF07B8DF7BAB9E12BF60FD2BBB739C46B86E", value: 51213 }, - { group: "Qty", value: 16932 }, + { + group: + "6591DA8668C339B1B39297C61091E320C35391AB7AFC15B469F96B8A2DD0C231", + value: 65000 + }, + { + group: + "347FEDE2F7403759069E5F84B65B49D2467D8914B5184738699259AA310EB0F9", + value: 29123 + }, + { + group: + "232D788298773BB389DBB8FCE44D3FB4E878879BE7AFB0B303BCE0D56EBB92E2", + value: 35213 + }, + { + group: + "58B01AADFA87E5547A218B3C6CE3AF07B8DF7BAB9E12BF60FD2BBB739C46B86E", + value: 51213 + }, + { group: "Qty", value: 16932 } ]; export const simpleBarLongLabelOptions = { title: "Simple bar (truncated labels)", axes: { left: { - mapsTo: "value", + mapsTo: "value" }, bottom: { mapsTo: "group", - scaleType: "labels", - }, + scaleType: "labels" + } }, legend: { truncation: { @@ -108,13 +124,13 @@ export const simpleBarFixedDomainOptions = { axes: { left: { mapsTo: "value", - domain: [-100000, 100000], + domain: [-100000, 100000] }, bottom: { scaleType: "labels", - mapsTo: "group", - }, - }, + mapsTo: "group" + } + } }; // Horizontal Simple @@ -126,12 +142,12 @@ export const simpleHorizontalBarOptions = { axes: { left: { mapsTo: "group", - scaleType: "labels", + scaleType: "labels" }, bottom: { - mapsTo: "value", - }, - }, + mapsTo: "value" + } + } }; export const simpleHorizontalBarLongLabelOptions = { @@ -144,11 +160,11 @@ export const simpleHorizontalBarLongLabelOptions = { type: "mid_line", threshold: 10, numCharacter: 14 - }, + } }, bottom: { - mapsTo: "value", - }, + mapsTo: "value" + } }, legend: { truncation: { @@ -164,21 +180,21 @@ export const simpleBarTimeSeriesData = [ { group: "More", date: new Date(2019, 0, 2), value: 65000 }, { group: "Sold", date: new Date(2019, 0, 3), value: 30000 }, { group: "Restocking", date: new Date(2019, 0, 6), value: 49213 }, - { group: "Misc", date: new Date(2019, 0, 7), value: 51213 }, + { group: "Misc", date: new Date(2019, 0, 7), value: 51213 } ]; export const simpleBarTimeSeriesOptions = { title: "Simple bar (time series - Turkish)", axes: { left: { - mapsTo: "value", + mapsTo: "value" }, bottom: { mapsTo: "date", - scaleType: "time", - }, + scaleType: "time" + } }, - timeScale: { localeObject: trLocaleObject }, + timeScale: { localeObject: trLocaleObject } }; // Horizontal simple time series @@ -187,12 +203,12 @@ export const simpleHorizontalBarTimeSeriesOptions = { axes: { left: { mapsTo: "date", - scaleType: "time", + scaleType: "time" }, bottom: { - mapsTo: "value", - }, - }, + mapsTo: "value" + } + } }; export const simpleHorizontalBarTimeSeriesData = simpleBarTimeSeriesData; @@ -218,7 +234,7 @@ export const stackedBarData = [ { group: "Dataset 4", key: "More", value: 21313 }, { group: "Dataset 4", key: "Sold", value: 64353 }, { group: "Dataset 4", key: "Restocking", value: 24134 }, - { group: "Dataset 4", key: "Misc", value: 32423 }, + { group: "Dataset 4", key: "Misc", value: 32423 } ]; export const stackedBarOptions = { @@ -226,13 +242,13 @@ export const stackedBarOptions = { axes: { left: { mapsTo: "value", - stacked: true, + stacked: true }, bottom: { mapsTo: "key", - scaleType: "labels", - }, - }, + scaleType: "labels" + } + } }; // horizontal stacked bar @@ -242,12 +258,12 @@ export const stackedHorizontalBarOptions = { title: "Stacked horizontal bar (discrete)", axes: { left: { - scaleType: "labels", + scaleType: "labels" }, bottom: { - stacked: true, - }, - }, + stacked: true + } + } }; export const stackedBarTimeSeriesData = [ @@ -270,7 +286,7 @@ export const stackedBarTimeSeriesData = [ { group: "Dataset 4", date: new Date(2019, 0, 6), value: 37312 }, { group: "Dataset 4", date: new Date(2019, 0, 8), value: 51432 }, { group: "Dataset 4", date: new Date(2019, 0, 15), value: 40323 }, - { group: "Dataset 4", date: new Date(2019, 0, 19), value: 31300 }, + { group: "Dataset 4", date: new Date(2019, 0, 19), value: 31300 } ]; export const stackedBarTimeSeriesOptions = { @@ -278,13 +294,13 @@ export const stackedBarTimeSeriesOptions = { axes: { left: { mapsTo: "value", - stacked: true, + stacked: true }, bottom: { mapsTo: "date", - scaleType: "time", - }, - }, + scaleType: "time" + } + } }; // Stacked horizontal bar (time series) @@ -292,12 +308,12 @@ export const stackedHorizontalBarTimeSeriesOptions = { title: "Stacked horizontal bar (time series)", axes: { left: { - scaleType: "time", + scaleType: "time" }, bottom: { - stacked: true, - }, - }, + stacked: true + } + } }; export const stackedHorizontalBarTimeSeriesData = stackedBarTimeSeriesData; @@ -308,13 +324,13 @@ export const simpleBarEmptyStateOptions = { title: "Simple bar (empty state)", axes: { left: { - primary: true, + primary: true }, bottom: { scaleType: "labels", - secondary: true, - }, - }, + secondary: true + } + } }; // simple bar - skeleton @@ -323,16 +339,16 @@ export const simpleBarSkeletonOptions = { title: "Simple bar (skeleton)", axes: { left: { - primary: true, + primary: true }, bottom: { scaleType: "labels", - secondary: true, - }, + secondary: true + } }, data: { - loading: true, - }, + loading: true + } }; // grouped bar - empty state @@ -341,13 +357,13 @@ export const groupedBarEmptyStateOptions = { title: "Grouped bar (empty state)", axes: { left: { - primary: true, + primary: true }, bottom: { scaleType: "labels", - secondary: true, - }, - }, + secondary: true + } + } }; // grouped bar - skeleton @@ -356,16 +372,16 @@ export const groupedBarSkeletonOptions = { title: "Grouped bar (skeleton)", axes: { left: { - primary: true, + primary: true }, bottom: { scaleType: "labels", - secondary: true, - }, + secondary: true + } }, data: { - loading: true, - }, + loading: true + } }; // stacked bar - empty state @@ -374,13 +390,13 @@ export const stackedBarEmptyStateOptions = { title: "Stacked bar (empty state)", axes: { left: { - primary: true, + primary: true }, bottom: { scaleType: "labels", - secondary: true, - }, - }, + secondary: true + } + } }; // stacked bar - skeleton @@ -389,16 +405,16 @@ export const stackedBarSkeletonOptions = { title: "Stacked bar (skeleton)", axes: { left: { - primary: true, + primary: true }, bottom: { scaleType: "labels", - secondary: true, - }, + secondary: true + } }, data: { - loading: true, - }, + loading: true + } }; // simple horizontal bar - empty state @@ -408,12 +424,12 @@ export const simpleHorizontalBarEmptyStateOptions = { axes: { left: { primary: true, - scaleType: "labels", + scaleType: "labels" }, bottom: { - secondary: true, - }, - }, + secondary: true + } + } }; // simple horizontal bar - skeleton @@ -423,15 +439,15 @@ export const simpleHorizontalBarSkeletonOptions = { axes: { left: { primary: true, - scaleType: "labels", + scaleType: "labels" }, bottom: { - secondary: true, - }, + secondary: true + } }, data: { - loading: true, - }, + loading: true + } }; // grouped horizontal bar - empty state @@ -441,12 +457,12 @@ export const groupedHorizontalBarEmptyStateOptions = { axes: { left: { primary: true, - scaleType: "labels", + scaleType: "labels" }, bottom: { - secondary: true, - }, - }, + secondary: true + } + } }; // grouped horizontal bar - skeleton @@ -456,15 +472,15 @@ export const groupedHorizontalBarSkeletonOptions = { axes: { left: { primary: true, - scaleType: "labels", + scaleType: "labels" }, bottom: { - secondary: true, - }, + secondary: true + } }, data: { - loading: true, - }, + loading: true + } }; // stacked horizontal bar - empty state @@ -474,12 +490,12 @@ export const stackedHorizontalBarEmptyStateOptions = { axes: { left: { primary: true, - scaleType: "labels", + scaleType: "labels" }, bottom: { - secondary: true, - }, - }, + secondary: true + } + } }; // stacked horizontal bar - skeleton @@ -489,13 +505,13 @@ export const stackedHorizontalBarSkeletonOptions = { axes: { left: { primary: true, - scaleType: "labels", + scaleType: "labels" }, bottom: { - secondary: true, - }, + secondary: true + } }, data: { - loading: true, - }, + loading: true + } }; diff --git a/packages/core/demo/data/bubble.ts b/packages/core/demo/data/bubble.ts index 4437505ff0..208e6cc53f 100644 --- a/packages/core/demo/data/bubble.ts +++ b/packages/core/demo/data/bubble.ts @@ -10,7 +10,7 @@ export const bubbleDoubleLinearData = [ { group: "Dataset 2", sales: 13000, profit: 34500, surplus: 35000 }, { group: "Dataset 2", sales: 13500, profit: 23100, surplus: 55000 }, { group: "Dataset 2", sales: 15500, profit: 63200, surplus: 35000 }, - { group: "Dataset 2", sales: 15750, profit: 24300, surplus: 64000 }, + { group: "Dataset 2", sales: 15750, profit: 24300, surplus: 64000 } ]; export const bubbleDoubleLinearOptions = { @@ -19,17 +19,17 @@ export const bubbleDoubleLinearOptions = { bottom: { title: "No. of employees", mapsTo: "sales", - includeZero: false, + includeZero: false }, left: { title: "Annual sales", mapsTo: "profit", - includeZero: false, - }, + includeZero: false + } }, bubble: { - radiusMapsTo: "surplus", - }, + radiusMapsTo: "surplus" + } }; export const bubbleDiscreteData = [ @@ -52,7 +52,7 @@ export const bubbleDiscreteData = [ { group: "Dataset 4", key: "More", value: 4000, surplus: 32000 }, { group: "Dataset 4", key: "Sold", value: 9000, surplus: 43000 }, { group: "Dataset 4", key: "Restocking", value: 24000, surplus: 43000 }, - { group: "Dataset 4", key: "Misc", value: 7000, surplus: 21000 }, + { group: "Dataset 4", key: "Misc", value: 7000, surplus: 21000 } ]; export const bubbleDiscreteOptions = { @@ -61,20 +61,20 @@ export const bubbleDiscreteOptions = { bottom: { title: "2019 Annual Sales Figures", scaleType: "labels", - mapsTo: "key", + mapsTo: "key" }, left: { - mapsTo: "value", - }, + mapsTo: "value" + } }, bubble: { - radiusMapsTo: "surplus", - }, + radiusMapsTo: "surplus" + } }; export const bubbleTimeSeriesData = lineTimeSeriesData.map((datum) => Object.assign(datum, { - surplus: 50000 * Math.random() * ((datum["value"] || 1) / 2), + surplus: 50000 * Math.random() * ((datum["value"] || 1) / 2) }) ); @@ -84,15 +84,15 @@ export const bubbleTimeSeriesOptions = { bottom: { title: "2019 Annual Sales Figures", scaleType: "time", - mapsTo: "date", + mapsTo: "date" }, left: { - mapsTo: "value", - }, + mapsTo: "value" + } }, bubble: { - radiusMapsTo: "surplus", - }, + radiusMapsTo: "surplus" + } }; // bubble - empty state @@ -103,17 +103,17 @@ export const bubbleEmptyStateOptions = { bottom: { title: "No. of employees", mapsTo: "sales", - includeZero: false, + includeZero: false }, left: { title: "Annual sales", mapsTo: "profit", - includeZero: false, - }, + includeZero: false + } }, bubble: { - radiusMapsTo: "surplus", - }, + radiusMapsTo: "surplus" + } }; // bubble - skeleton @@ -124,18 +124,18 @@ export const bubbleSkeletonOptions = { bottom: { title: "No. of employees", mapsTo: "sales", - includeZero: false, + includeZero: false }, left: { title: "Annual sales", mapsTo: "profit", - includeZero: false, - }, + includeZero: false + } }, bubble: { - radiusMapsTo: "surplus", + radiusMapsTo: "surplus" }, data: { - loading: true, - }, + loading: true + } }; diff --git a/packages/core/demo/data/index.ts b/packages/core/demo/data/index.ts index 703e459214..eb6d3e582b 100644 --- a/packages/core/demo/data/index.ts +++ b/packages/core/demo/data/index.ts @@ -145,7 +145,7 @@ let allDemoGroups = [ options: barDemos.simpleBarLongLabelOptions, data: barDemos.simpleBarLongLabelData, chartType: chartTypes.SimpleBarChart, - isDemoExample: true, + isDemoExample: true }, { options: barDemos.simpleBarTimeSeriesOptions, @@ -226,7 +226,7 @@ let allDemoGroups = [ options: barDemos.simpleHorizontalBarLongLabelOptions, data: barDemos.simpleHorizontalBarLongLabelData, chartType: chartTypes.SimpleBarChart, - isDemoExample: true, + isDemoExample: true }, { options: barDemos.simpleHorizontalBarTimeSeriesOptions, @@ -355,7 +355,7 @@ let allDemoGroups = [ { options: lineDemos.lineTimeSeriesCustomDomainOptions, data: lineDemos.lineTimeSeriesData, - chartType: chartTypes.LineChart, + chartType: chartTypes.LineChart }, { options: lineDemos.lineTimeSeriesDenseOptions, @@ -370,12 +370,12 @@ let allDemoGroups = [ { options: lineDemos.lineLongLabelOptions, data: lineDemos.lineLongLabelData, - chartType: chartTypes.LineChart, + chartType: chartTypes.LineChart }, { options: lineDemos.lineCustomDomainOptions, data: lineDemos.lineData, - chartType: chartTypes.LineChart, + chartType: chartTypes.LineChart }, { options: lineDemos.lineTimeSeriesRotatedTicksOptions, @@ -482,7 +482,7 @@ let allDemoGroups = [ { options: scatterDemos.scatterLongLabelDiscreteOptions, data: scatterDemos.scatterLongLabelDiscreteData, - chartType: chartTypes.ScatterChart, + chartType: chartTypes.ScatterChart }, { options: scatterDemos.scatterEmptyStateOptions, diff --git a/packages/core/demo/data/line.ts b/packages/core/demo/data/line.ts index b57e8fcb3d..07002eafd7 100644 --- a/packages/core/demo/data/line.ts +++ b/packages/core/demo/data/line.ts @@ -20,7 +20,7 @@ export const lineData = [ { group: "Dataset 4", key: "More", value: 1200 }, { group: "Dataset 4", key: "Sold", value: 9000 }, { group: "Dataset 4", key: "Restocking", value: 24000, audienceSize: 10 }, - { group: "Dataset 4", key: "Misc", value: 3000, audienceSize: 10 }, + { group: "Dataset 4", key: "Misc", value: 3000, audienceSize: 10 } ]; export const lineOptions = { @@ -29,37 +29,59 @@ export const lineOptions = { bottom: { title: "2019 Annual Sales Figures", mapsTo: "key", - scaleType: "labels", + scaleType: "labels" }, left: { mapsTo: "value", title: "Conversion rate", - scaleType: "linear", - }, - }, + scaleType: "linear" + } + } }; export const lineLongLabelData = [ { group: "Dataset 1", key: "Qty", value: 34200 }, { group: "Dataset 1", key: "More", value: 23500 }, { group: "Dataset 1", key: "Sold", value: 53100 }, - { group: "Dataset 1", key: "347FEDE2F7403759069E5F84B65B49D2467D8914B5184738699259AA310EB0F9", value: 42300 }, + { + group: "Dataset 1", + key: "347FEDE2F7403759069E5F84B65B49D2467D8914B5184738699259AA310EB0F9", + value: 42300 + }, { group: "Dataset 1", key: "Misc", value: 12300 }, { group: "Dataset 2", key: "Qty", value: 34200 }, { group: "Dataset 2", key: "More", value: 53200 }, { group: "Dataset 2", key: "Sold", value: 42300 }, - { group: "Dataset 2", key: "347FEDE2F7403759069E5F84B65B49D2467D8914B5184738699259AA310EB0F9", value: 21400 }, + { + group: "Dataset 2", + key: "347FEDE2F7403759069E5F84B65B49D2467D8914B5184738699259AA310EB0F9", + value: 21400 + }, { group: "Dataset 2", key: "Misc", value: 0 }, { group: "Dataset 3", key: "Qty", value: 41200 }, { group: "Dataset 3", key: "More", value: 18400 }, { group: "Dataset 3", key: "Sold", value: 34210 }, - { group: "Dataset 3", key: "347FEDE2F7403759069E5F84B65B49D2467D8914B5184738699259AA310EB0F9", value: 1400 }, + { + group: "Dataset 3", + key: "347FEDE2F7403759069E5F84B65B49D2467D8914B5184738699259AA310EB0F9", + value: 1400 + }, { group: "Dataset 3", key: "Misc", value: 42100 }, { group: "LongLabelShouldBeTruncated", key: "Qty", value: 22000 }, { group: "LongLabelShouldBeTruncated", key: "More", value: 1200 }, { group: "LongLabelShouldBeTruncated", key: "Sold", value: 9000 }, - { group: "LongLabelShouldBeTruncated", key: "347FEDE2F7403759069E5F84B65B49D2467D8914B5184738699259AA310EB0F9", value: 24000, audienceSize: 10 }, - { group: "LongLabelShouldBeTruncated", key: "Misc", value: 3000, audienceSize: 10 }, + { + group: "LongLabelShouldBeTruncated", + key: "347FEDE2F7403759069E5F84B65B49D2467D8914B5184738699259AA310EB0F9", + value: 24000, + audienceSize: 10 + }, + { + group: "LongLabelShouldBeTruncated", + key: "Misc", + value: 3000, + audienceSize: 10 + } ]; export const lineLongLabelOptions = { @@ -68,14 +90,14 @@ export const lineLongLabelOptions = { bottom: { title: "2019 Annual Sales Figures", mapsTo: "key", - scaleType: "labels", + scaleType: "labels" }, left: { mapsTo: "value", title: "Conversion rate", - scaleType: "linear", - }, - }, + scaleType: "linear" + } + } }; export const lineCustomDomainOptions = { @@ -85,15 +107,15 @@ export const lineCustomDomainOptions = { title: "2019 Annual Sales Figures", mapsTo: "key", scaleType: "labels", - domain: ['Qty', 'More', 'Misc'] + domain: ["Qty", "More", "Misc"] }, left: { domain: [10000, 50000], mapsTo: "value", title: "Conversion rate", - scaleType: "linear", - }, - }, + scaleType: "linear" + } + } }; export const lineTimeSeriesData = [ @@ -116,7 +138,7 @@ export const lineTimeSeriesData = [ { group: "Dataset 4", date: new Date(2019, 0, 6), value: 37312 }, { group: "Dataset 4", date: new Date(2019, 0, 8), value: 51432 }, { group: "Dataset 4", date: new Date(2019, 0, 15), value: 25332 }, - { group: "Dataset 4", date: new Date(2019, 0, 19), value: null }, + { group: "Dataset 4", date: new Date(2019, 0, 19), value: null } ]; export const lineTimeSeriesOptions = { @@ -125,15 +147,15 @@ export const lineTimeSeriesOptions = { bottom: { title: "2019 Annual Sales Figures", mapsTo: "date", - scaleType: "time", + scaleType: "time" }, left: { mapsTo: "value", title: "Conversion rate", - scaleType: "linear", - }, + scaleType: "linear" + } }, - curve: "curveMonotoneX", + curve: "curveMonotoneX" }; export const lineTimeSeriesCustomDomainOptions = { @@ -143,15 +165,15 @@ export const lineTimeSeriesCustomDomainOptions = { title: "2019 Annual Sales Figures", domain: [new Date(2019, 0, 5), new Date(2019, 0, 15)], mapsTo: "date", - scaleType: "time", + scaleType: "time" }, left: { mapsTo: "value", title: "Conversion rate", - scaleType: "linear", - }, + scaleType: "linear" + } }, - curve: "curveMonotoneX", + curve: "curveMonotoneX" }; export const lineTimeSeriesWithThresholdsOptions = { @@ -165,9 +187,9 @@ export const lineTimeSeriesWithThresholdsOptions = { { value: new Date(2019, 0, 11), label: "Custom formatter", - valueFormatter: timeFormat("%b %d"), - }, - ], + valueFormatter: timeFormat("%b %d") + } + ] }, left: { mapsTo: "value", @@ -175,11 +197,11 @@ export const lineTimeSeriesWithThresholdsOptions = { scaleType: "linear", thresholds: [ { value: 55000, label: "Custom label", fillColor: "orange" }, - { value: 10000, fillColor: "#03a9f4" }, - ], - }, + { value: 10000, fillColor: "#03a9f4" } + ] + } }, - curve: "curveMonotoneX", + curve: "curveMonotoneX" }; export const lineTimeSeriesDenseData = [ @@ -222,7 +244,7 @@ export const lineTimeSeriesDenseData = [ { group: "Dataset 2", date: new Date(2019, 0, 14), value: 40000 }, { group: "Dataset 2", date: new Date(2019, 0, 15, 5), value: 45000 }, { group: "Dataset 2", date: new Date(2019, 0, 15, 10), value: 35000 }, - { group: "Dataset 2", date: new Date(2019, 0, 15, 18), value: 30000 }, + { group: "Dataset 2", date: new Date(2019, 0, 15, 18), value: 30000 } ]; export const lineTimeSeriesDenseOptions = { @@ -231,15 +253,15 @@ export const lineTimeSeriesDenseOptions = { bottom: { title: "2019 Annual Sales Figures", mapsTo: "date", - scaleType: "time", + scaleType: "time" }, left: { mapsTo: "value", title: "Conversion rate", - scaleType: "linear", - }, + scaleType: "linear" + } }, - curve: "curveMonotoneX", + curve: "curveMonotoneX" }; export const lineTimeSeriesDataRotatedTicks = [ @@ -247,7 +269,7 @@ export const lineTimeSeriesDataRotatedTicks = [ { group: "Dataset 1", date: new Date(2019, 11, 31), value: 23500 }, { group: "Dataset 1", date: new Date(2020, 0, 1), value: 53100 }, { group: "Dataset 1", date: new Date(2020, 0, 2), value: 42300 }, - { group: "Dataset 1", date: new Date(2020, 0, 3), value: 12300 }, + { group: "Dataset 1", date: new Date(2020, 0, 3), value: 12300 } ]; export const lineTimeSeriesRotatedTicksOptions = { @@ -256,12 +278,12 @@ export const lineTimeSeriesRotatedTicksOptions = { axes: { bottom: { scaleType: "time", - mapsTo: "date", + mapsTo: "date" }, left: { - mapsTo: "value", - }, - }, + mapsTo: "value" + } + } }; export const lineHorizontalOptions = { @@ -270,14 +292,14 @@ export const lineHorizontalOptions = { left: { title: "2019 Annual Sales Figures", mapsTo: "key", - scaleType: "labels", + scaleType: "labels" }, bottom: { mapsTo: "value", title: "Conversion rate", - scaleType: "linear", - }, - }, + scaleType: "linear" + } + } }; export const lineTimeSeriesHorizontalOptions = { @@ -286,15 +308,15 @@ export const lineTimeSeriesHorizontalOptions = { left: { title: "2019 Annual Sales Figures", mapsTo: "date", - scaleType: "time", + scaleType: "time" }, bottom: { mapsTo: "value", title: "Conversion rate", - scaleType: "linear", - }, + scaleType: "linear" + } }, - curve: "curveMonotoneY", + curve: "curveMonotoneY" }; // line - empty state @@ -305,15 +327,15 @@ export const lineEmptyStateOptions = { bottom: { title: "2019 Annual Sales Figures", mapsTo: "date", - scaleType: "time", + scaleType: "time" }, left: { mapsTo: "value", title: "Conversion rate", - scaleType: "linear", - }, + scaleType: "linear" + } }, - curve: "curveMonotoneX", + curve: "curveMonotoneX" }; // line - skeleton @@ -324,16 +346,16 @@ export const lineSkeletonOptions = { bottom: { title: "2019 Annual Sales Figures", mapsTo: "date", - scaleType: "time", + scaleType: "time" }, left: { mapsTo: "value", title: "Conversion rate", - scaleType: "linear", - }, + scaleType: "linear" + } }, curve: "curveMonotoneX", data: { - loading: true, - }, + loading: true + } }; diff --git a/packages/core/demo/data/pie.ts b/packages/core/demo/data/pie.ts index b4f61c2109..3eeaa2a24b 100644 --- a/packages/core/demo/data/pie.ts +++ b/packages/core/demo/data/pie.ts @@ -4,19 +4,19 @@ export const pieData = [ { group: "JQAI 2M4L1", value: 75000 }, { group: "J9DZ F37AP", value: 1200 }, { group: "YEL48 Q6XK YEL48", value: 10000 }, - { group: "Misc", value: 25000 }, + { group: "Misc", value: 25000 } ]; export const pieOptions = { title: "Pie", - resizable: true, + resizable: true }; // pie - empty state export const pieEmptyStateData = []; export const pieEmptyStateOptions = { title: "Pie (empty state)", - resizable: true, + resizable: true }; // pie - skeleton @@ -25,6 +25,6 @@ export const pieSkeletonOptions = { title: "Pie (skeleton)", resizable: true, data: { - loading: true, - }, + loading: true + } }; diff --git a/packages/core/demo/data/radar.ts b/packages/core/demo/data/radar.ts index 0f2b3eac10..f33aca3fbe 100644 --- a/packages/core/demo/data/radar.ts +++ b/packages/core/demo/data/radar.ts @@ -9,19 +9,19 @@ export const radarData = [ { product: "Product 2", feature: "Usability", score: 63 }, { product: "Product 2", feature: "Availability", score: 78 }, { product: "Product 2", feature: "Performance", score: 50 }, - { product: "Product 2", feature: "Quality", score: 30 }, + { product: "Product 2", feature: "Quality", score: 30 } ]; export const radarOptions = { title: "Radar", radar: { axes: { angle: "feature", - value: "score", - }, + value: "score" + } }, data: { - groupMapsTo: "product", - }, + groupMapsTo: "product" + } }; // radar with missing data @@ -39,10 +39,10 @@ export const radarWithMissingDataData = [ { group: "Oil", key: "New York", value: 18 }, { group: "Water", key: "New York", value: 8 }, { group: "Sugar", key: "Sydney", value: 12 }, - { group: "Oil", key: "Sydney", value: 16 }, + { group: "Oil", key: "Sydney", value: 16 } ]; export const radarWithMissingDataOptions = { - title: "Radar - Missing datapoints", + title: "Radar - Missing datapoints" }; // radar dense @@ -86,17 +86,17 @@ export const radarDenseData = [ { month: "May", activity: "Walking", hoursAvg: 8 }, { month: "May", activity: "Running", hoursAvg: 2 }, { month: "May", activity: "Cycling", hoursAvg: 3 }, - { month: "May", activity: "Swimming", hoursAvg: 1 }, + { month: "May", activity: "Swimming", hoursAvg: 1 } ]; export const radarDenseOptions = { title: "Radar - Dense", radar: { axes: { angle: "activity", - value: "hoursAvg", - }, + value: "hoursAvg" + } }, data: { - groupMapsTo: "month", - }, + groupMapsTo: "month" + } }; diff --git a/packages/core/demo/data/scatter.ts b/packages/core/demo/data/scatter.ts index 2d7065e1c1..abf1de90ff 100644 --- a/packages/core/demo/data/scatter.ts +++ b/packages/core/demo/data/scatter.ts @@ -9,7 +9,7 @@ export const doubleLinearScatterData = [ { group: "Dataset 2", employees: 2000, sales: 34100 }, { group: "Dataset 2", employees: 4000, sales: 23100 }, { group: "Dataset 2", employees: 7000, sales: 14100 }, - { group: "Dataset 2", employees: 6000, sales: 53100 }, + { group: "Dataset 2", employees: 6000, sales: 53100 } ]; export const doubleLinearScatterOptions = { @@ -18,14 +18,14 @@ export const doubleLinearScatterOptions = { bottom: { title: "No. of employees", mapsTo: "employees", - scaleType: "linear", + scaleType: "linear" }, left: { title: "Annual sales", mapsTo: "sales", - scaleType: "linear", - }, - }, + scaleType: "linear" + } + } }; export const scatterDiscreteData = [ @@ -48,7 +48,7 @@ export const scatterDiscreteData = [ { group: "Dataset 4", key: "More", value: 1200 }, { group: "Dataset 4", key: "Sold", value: 9000 }, { group: "Dataset 4", key: "Restocking", value: 24000 }, - { group: "Dataset 4", key: "Misc", value: 3000 }, + { group: "Dataset 4", key: "Misc", value: 3000 } ]; export const scatterDiscreteOptions = { @@ -57,35 +57,51 @@ export const scatterDiscreteOptions = { bottom: { title: "2019 Annual Sales Figures", scaleType: "labels", - mapsTo: "key", + mapsTo: "key" }, left: { - mapsTo: "value", - }, - }, + mapsTo: "value" + } + } }; export const scatterLongLabelDiscreteData = [ { group: "Dataset 1", key: "Qty", value: 34200 }, - { group: "Dataset 1", key: "6591DA8668C339B1B39297C61091E320C35391AB7AFC15B469F96B8A2DD0C231", value: 23500 }, + { + group: "Dataset 1", + key: "6591DA8668C339B1B39297C61091E320C35391AB7AFC15B469F96B8A2DD0C231", + value: 23500 + }, { group: "Dataset 1", key: "Sold", value: 53100 }, { group: "Dataset 1", key: "Restocking", value: 42300 }, { group: "Dataset 1", key: "Misc", value: 12300 }, { group: "Dataset 2", key: "Qty", value: 34200 }, - { group: "Dataset 2", key: "6591DA8668C339B1B39297C61091E320C35391AB7AFC15B469F96B8A2DD0C231", value: 53200 }, + { + group: "Dataset 2", + key: "6591DA8668C339B1B39297C61091E320C35391AB7AFC15B469F96B8A2DD0C231", + value: 53200 + }, { group: "Dataset 2", key: "Sold", value: 42300 }, { group: "Dataset 2", key: "Restocking", value: 21400 }, { group: "Dataset 2", key: "Misc", value: 0 }, { group: "Dataset 3", key: "Qty", value: 41200 }, - { group: "Dataset 3", key: "6591DA8668C339B1B39297C61091E320C35391AB7AFC15B469F96B8A2DD0C231", value: 18400 }, + { + group: "Dataset 3", + key: "6591DA8668C339B1B39297C61091E320C35391AB7AFC15B469F96B8A2DD0C231", + value: 18400 + }, { group: "Dataset 3", key: "Sold", value: 34210 }, { group: "Dataset 3", key: "Restocking", value: 1400 }, { group: "Dataset 3", key: "Misc", value: 42100 }, { group: "LongLabelShouldBeTruncated", key: "Qty", value: 22000 }, - { group: "LongLabelShouldBeTruncated", key: "6591DA8668C339B1B39297C61091E320C35391AB7AFC15B469F96B8A2DD0C231", value: 1200 }, + { + group: "LongLabelShouldBeTruncated", + key: "6591DA8668C339B1B39297C61091E320C35391AB7AFC15B469F96B8A2DD0C231", + value: 1200 + }, { group: "LongLabelShouldBeTruncated", key: "Sold", value: 9000 }, { group: "LongLabelShouldBeTruncated", key: "Restocking", value: 24000 }, - { group: "LongLabelShouldBeTruncated", key: "Misc", value: 3000 }, + { group: "LongLabelShouldBeTruncated", key: "Misc", value: 3000 } ]; export const scatterLongLabelDiscreteOptions = { @@ -94,12 +110,12 @@ export const scatterLongLabelDiscreteOptions = { bottom: { title: "2019 Annual Sales Figures", scaleType: "labels", - mapsTo: "key", + mapsTo: "key" }, left: { - mapsTo: "value", - }, - }, + mapsTo: "value" + } + } }; export const scatterTimeSeriesData = lineTimeSeriesData; @@ -110,12 +126,12 @@ export const scatterTimeSeriesOptions = { bottom: { title: "2019 Annual Sales Figures", scaleType: "time", - mapsTo: "date", + mapsTo: "date" }, left: { - mapsTo: "value", - }, - }, + mapsTo: "value" + } + } }; // scatter - empty state @@ -126,12 +142,12 @@ export const scatterEmptyStateOptions = { bottom: { title: "2019 Annual Sales Figures", scaleType: "time", - mapsTo: "date", + mapsTo: "date" }, left: { - mapsTo: "value", - }, - }, + mapsTo: "value" + } + } }; // scatter - skeleton @@ -142,13 +158,13 @@ export const scatterSkeletonOptions = { bottom: { title: "2019 Annual Sales Figures", scaleType: "time", - mapsTo: "date", + mapsTo: "date" }, left: { - mapsTo: "value", - }, + mapsTo: "value" + } }, data: { - loading: true, - }, + loading: true + } }; diff --git a/packages/core/demo/data/step.ts b/packages/core/demo/data/step.ts index f4a8b11c3d..06b3ec2402 100644 --- a/packages/core/demo/data/step.ts +++ b/packages/core/demo/data/step.ts @@ -4,19 +4,19 @@ import { lineData, lineOptions, lineTimeSeriesData, - lineTimeSeriesOptions, + lineTimeSeriesOptions } from "./line"; export const stepOptions = Tools.merge({}, lineOptions, { title: "Step (discrete)", - curve: "curveStepAfter", + curve: "curveStepAfter" }); export const stepData = lineData; export const stepTimeSeriesOptions = Tools.merge({}, lineTimeSeriesOptions, { title: "Step (time series)", - curve: "curveStepAfter", + curve: "curveStepAfter" }); export const stepTimeSeriesData = lineTimeSeriesData; @@ -25,7 +25,7 @@ export const stepTimeSeriesData = lineTimeSeriesData; export const stepEmptyStateData = []; export const stepEmptyStateOptions = Tools.merge({}, lineTimeSeriesOptions, { title: "Step (empty state)", - curve: "curveStepAfter", + curve: "curveStepAfter" }); // step - skeleton @@ -34,6 +34,6 @@ export const stepSkeletonOptions = Tools.merge({}, lineTimeSeriesOptions, { title: "Step (skeleton)", curve: "curveStepAfter", data: { - loading: true, - }, + loading: true + } }); diff --git a/packages/core/demo/data/time-series-axis.ts b/packages/core/demo/data/time-series-axis.ts index 2c11983c3c..e3a3502c92 100644 --- a/packages/core/demo/data/time-series-axis.ts +++ b/packages/core/demo/data/time-series-axis.ts @@ -13,10 +13,10 @@ export const lineTimeSeriesData15seconds = { { date: new Date(2020, 11, 11, 0, 0, 0), value: 10 }, { date: new Date(2020, 11, 11, 0, 0, 15), value: 10 }, { date: new Date(2020, 11, 11, 0, 0, 30), value: 10 }, - { date: new Date(2020, 11, 11, 0, 0, 45), value: 10 }, - ], - }, - ], + { date: new Date(2020, 11, 11, 0, 0, 45), value: 10 } + ] + } + ] }; export const lineTimeSeries15secondsOptions = { @@ -24,9 +24,9 @@ export const lineTimeSeries15secondsOptions = { axes: { left: {}, bottom: { - scaleType: "time", - }, - }, + scaleType: "time" + } + } }; // minute @@ -42,10 +42,10 @@ export const lineTimeSeriesDataMinute = { { date: new Date(2020, 4, 22, 0, 0), value: 10 }, { date: new Date(2020, 4, 22, 0, 5), value: 10 }, { date: new Date(2020, 4, 22, 0, 7), value: 10 }, - { date: new Date(2020, 4, 22, 0, 10), value: 10 }, - ], - }, - ], + { date: new Date(2020, 4, 22, 0, 10), value: 10 } + ] + } + ] }; export const lineTimeSeriesMinuteOptions = { @@ -53,9 +53,9 @@ export const lineTimeSeriesMinuteOptions = { axes: { left: {}, bottom: { - scaleType: "time", - }, - }, + scaleType: "time" + } + } }; // 30minutes @@ -70,10 +70,10 @@ export const lineTimeSeriesData30minutes = { { date: new Date(2020, 11, 11, 0, 0), value: 10 }, { date: new Date(2020, 11, 11, 0, 30), value: 10 }, { date: new Date(2020, 11, 11, 1, 0), value: 10 }, - { date: new Date(2020, 11, 11, 1, 30), value: 10 }, - ], - }, - ], + { date: new Date(2020, 11, 11, 1, 30), value: 10 } + ] + } + ] }; export const lineTimeSeries30minutesOptions = { @@ -81,9 +81,9 @@ export const lineTimeSeries30minutesOptions = { axes: { left: {}, bottom: { - scaleType: "time", - }, - }, + scaleType: "time" + } + } }; // hourly with default ticks formats @@ -99,10 +99,10 @@ export const lineTimeSeriesDataHourlyDefaultTicksFormats = { { date: new Date(2020, 11, 11, 1, 0), value: 10 }, { date: new Date(2020, 11, 11, 2, 0), value: 10 }, { date: new Date(2020, 11, 11, 3, 0), value: 10 }, - { date: new Date(2020, 11, 11, 4, 0), value: 10 }, - ], - }, - ], + { date: new Date(2020, 11, 11, 4, 0), value: 10 } + ] + } + ] }; export const lineTimeSeriesHourlyDefaultLocaleOptions = { @@ -111,9 +111,9 @@ export const lineTimeSeriesHourlyDefaultLocaleOptions = { axes: { left: {}, bottom: { - scaleType: "time", - }, - }, + scaleType: "time" + } + } }; // hourly with custom ticks formats @@ -125,14 +125,14 @@ export const lineTimeSeriesHourlyCustomTicksFormatsOptions = { axes: { left: {}, bottom: { - scaleType: "time", - }, + scaleType: "time" + } }, timeScale: { timeIntervalFormats: { - hourly: { primary: "MMM d, HH:mm", secondary: "HH:mm" }, - }, - }, + hourly: { primary: "MMM d, HH:mm", secondary: "HH:mm" } + } + } }; // daily @@ -148,10 +148,10 @@ export const lineTimeSeriesDataDaily = { { date: new Date(2020, 0, 2), value: 10 }, { date: new Date(2020, 0, 3), value: 10 }, { date: new Date(2020, 0, 4), value: 10 }, - { date: new Date(2020, 0, 5), value: 10 }, - ], - }, - ], + { date: new Date(2020, 0, 5), value: 10 } + ] + } + ] }; export const lineTimeSeriesDailyOptions = { @@ -159,9 +159,9 @@ export const lineTimeSeriesDailyOptions = { axes: { left: {}, bottom: { - scaleType: "time", - }, - }, + scaleType: "time" + } + } }; // weekly @@ -177,10 +177,10 @@ export const lineTimeSeriesDataWeekly = { { date: new Date(2020, 0, 2), value: 10 }, { date: new Date(2020, 0, 3), value: 10 }, { date: new Date(2020, 0, 4), value: 10 }, - { date: new Date(2020, 0, 5), value: 10 }, - ], - }, - ], + { date: new Date(2020, 0, 5), value: 10 } + ] + } + ] }; export const lineTimeSeriesWeeklyOptions = { @@ -188,12 +188,12 @@ export const lineTimeSeriesWeeklyOptions = { axes: { left: {}, bottom: { - scaleType: "time", - }, + scaleType: "time" + } }, timeScale: { - showDayName: true, - }, + showDayName: true + } }; // monthly with default locale @@ -209,10 +209,10 @@ export const lineTimeSeriesDataMonthlyDefaultLocale = { { date: new Date(2019, 0), value: 10 }, { date: new Date(2019, 1), value: 10 }, { date: new Date(2019, 2), value: 10 }, - { date: new Date(2019, 3), value: 10 }, - ], - }, - ], + { date: new Date(2019, 3), value: 10 } + ] + } + ] }; export const lineTimeSeriesMonthlyDefaultLocaleOptions = { @@ -220,9 +220,9 @@ export const lineTimeSeriesMonthlyDefaultLocaleOptions = { axes: { left: {}, bottom: { - scaleType: "time", - }, - }, + scaleType: "time" + } + } }; // monthly with custom locale @@ -233,12 +233,12 @@ export const lineTimeSeriesMonthlyCustomLocaleOptions = { axes: { left: {}, bottom: { - scaleType: "time", - }, + scaleType: "time" + } }, timeScale: { - localeObject: frLocaleObject, - }, + localeObject: frLocaleObject + } }; // quarterly @@ -254,10 +254,10 @@ export const lineTimeSeriesDataQuarterly = { { date: new Date(2018, 9), value: 10 }, { date: new Date(2019, 0), value: 10 }, { date: new Date(2019, 3), value: 10 }, - { date: new Date(2019, 6), value: 10 }, - ], - }, - ], + { date: new Date(2019, 6), value: 10 } + ] + } + ] }; export const lineTimeSeriesQuarterlyOptions = { @@ -265,9 +265,9 @@ export const lineTimeSeriesQuarterlyOptions = { axes: { left: {}, bottom: { - scaleType: "time", - }, - }, + scaleType: "time" + } + } }; // yearly @@ -283,10 +283,10 @@ export const lineTimeSeriesDataYearly = { { date: new Date(1980, 0), value: 10 }, { date: new Date(1981, 0), value: 10 }, { date: new Date(1982, 0), value: 10 }, - { date: new Date(1983, 0), value: 10 }, - ], - }, - ], + { date: new Date(1983, 0), value: 10 } + ] + } + ] }; export const lineTimeSeriesYearlyOptions = { @@ -294,9 +294,9 @@ export const lineTimeSeriesYearlyOptions = { axes: { left: {}, bottom: { - scaleType: "time", - }, - }, + scaleType: "time" + } + } }; // single datum @@ -305,9 +305,9 @@ export const lineTimeSeriesDataSingleDatum = { datasets: [ { label: "Dataset 1", - data: [{ date: new Date("2020-01-06T19:43:16Z"), value: 10 }], - }, - ], + data: [{ date: new Date("2020-01-06T19:43:16Z"), value: 10 }] + } + ] }; export const lineTimeSeriesSingleDatumOptions = { @@ -315,9 +315,9 @@ export const lineTimeSeriesSingleDatumOptions = { axes: { left: {}, bottom: { - scaleType: "time", - }, - }, + scaleType: "time" + } + } }; // addSpaceOnEdges = 0 @@ -333,10 +333,10 @@ export const lineTimeSeriesNoExtendedDomainData = { { date: new Date(2020, 0, 2), value: 10 }, { date: new Date(2020, 0, 3), value: 10 }, { date: new Date(2020, 0, 4), value: 10 }, - { date: new Date(2020, 0, 5), value: 10 }, - ], - }, - ], + { date: new Date(2020, 0, 5), value: 10 } + ] + } + ] }; export const lineTimeSeriesNoExtendedDomainOptions = { @@ -344,12 +344,12 @@ export const lineTimeSeriesNoExtendedDomainOptions = { axes: { left: {}, bottom: { - scaleType: "time", - }, + scaleType: "time" + } }, timeScale: { - addSpaceOnEdges: 0, - }, + addSpaceOnEdges: 0 + } }; // bug two identical labels @@ -360,10 +360,10 @@ export const lineTimeSeriesDataTwoIdenticalLabels = { label: "Dataset 1", data: [ { date: new Date(2020, 0, 23, 23, 0), value: 10 }, - { date: new Date(2020, 1, 9, 23, 0), value: 10 }, - ], - }, - ], + { date: new Date(2020, 1, 9, 23, 0), value: 10 } + ] + } + ] }; export const lineTimeSeriesTwoIdenticalLabelsOptions = { @@ -371,12 +371,12 @@ export const lineTimeSeriesTwoIdenticalLabelsOptions = { axes: { left: {}, bottom: { - scaleType: "time", - }, + scaleType: "time" + } }, timeScale: { - addSpaceOnEdges: 0, - }, + addSpaceOnEdges: 0 + } }; export const lineTimeSeriesTwoIdenticalLabels2Options = { @@ -384,12 +384,12 @@ export const lineTimeSeriesTwoIdenticalLabels2Options = { axes: { left: {}, bottom: { - scaleType: "time", - }, + scaleType: "time" + } }, timeScale: { - addSpaceOnEdges: 0, - }, + addSpaceOnEdges: 0 + } }; // bug all labels in primary format @@ -400,10 +400,10 @@ export const lineTimeSeriesDataAllLabelsInPrimaryFormat = { label: "Dataset 1", data: [ { date: new Date(2020, 0, 23, 1, 0), value: 10 }, - { date: new Date(2020, 0, 29, 1, 0), value: 10 }, - ], - }, - ], + { date: new Date(2020, 0, 29, 1, 0), value: 10 } + ] + } + ] }; export const lineTimeSeriesAllLabelsInPrimaryFormatOptions = { @@ -411,10 +411,10 @@ export const lineTimeSeriesAllLabelsInPrimaryFormatOptions = { axes: { left: {}, bottom: { - scaleType: "time", - }, + scaleType: "time" + } }, timeScale: { - addSpaceOnEdges: 0, - }, + addSpaceOnEdges: 0 + } }; diff --git a/packages/core/karma.conf.js b/packages/core/karma.conf.js index 87e02ceb07..7b469b9f3b 100644 --- a/packages/core/karma.conf.js +++ b/packages/core/karma.conf.js @@ -13,7 +13,7 @@ module.exports = function (config) { "karma-webpack", "karma-chrome-launcher", "karma-firefox-launcher", - "karma-safari-launcher", + "karma-safari-launcher" ], // list of files / patterns to load in the browser files: ["**/*.spec.ts"], @@ -22,7 +22,7 @@ module.exports = function (config) { // preprocess matching files before serving them to the browser // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor preprocessors: { - "**/*.ts": ["webpack"], + "**/*.ts": ["webpack"] }, // webpack config webpack: { @@ -33,12 +33,12 @@ module.exports = function (config) { test: /\.ts$/, loader: "ts-loader", options: { - transpileOnly: true, - }, + transpileOnly: true + } }, { test: /\.html?$/, - loader: "html-loader", + loader: "html-loader" }, { test: /\.scss$/, @@ -46,18 +46,18 @@ module.exports = function (config) { "style-loader", "css-loader", "postcss-loader", - "sass-loader", - ], + "sass-loader" + ] }, { test: /\.svg?$/, - loader: "raw-loader", - }, - ], + loader: "raw-loader" + } + ] }, resolve: { - extensions: [".ts", ".js"], - }, + extensions: [".ts", ".js"] + } }, // test results reporter to use // possible values: "dots", "progress" @@ -77,23 +77,23 @@ module.exports = function (config) { browsers, browserConsoleLogOptions: { terminal: true, - level: "warn", + level: "warn" }, customLaunchers: { FirefoxHeadless: { base: "Firefox", - flags: ["-headless"], + flags: ["-headless"] }, ChromeNoSandbox: { base: "ChromeHeadless", - flags: ["--no-sandbox"], - }, + flags: ["--no-sandbox"] + } }, // Continuous Integration mode // if true, Karma captures browsers, runs the tests and exits singleRun: !!process.env.CI, // Concurrency level // how many browser should be started simultaneous - concurrency: Infinity, + concurrency: Infinity }); }; diff --git a/packages/core/rollup.config.js b/packages/core/rollup.config.js index 4744c9f6e1..b35b200c9e 100644 --- a/packages/core/rollup.config.js +++ b/packages/core/rollup.config.js @@ -20,8 +20,8 @@ export default { "d3-axis": "d3Axis", "d3-array": "d3Array", "d3-hierarchy": "d3Hierarchy", - "d3-time-format": "d3TimeFormat", - }, + "d3-time-format": "d3TimeFormat" + } }, plugins: [ resolve(), @@ -29,9 +29,9 @@ export default { json(), typescript({ typescript: require("typescript"), - tsconfig: "./src/tsconfig.json", + tsconfig: "./src/tsconfig.json" }), - terser(), + terser() ], onwarn(warning, next) { // logs the circular dependencies inside the d3 codebase @@ -47,5 +47,5 @@ export default { } next(warning); - }, + } }; diff --git a/packages/core/rollup.demo.js b/packages/core/rollup.demo.js index b6aed4a772..6e1b5b7526 100644 --- a/packages/core/rollup.demo.js +++ b/packages/core/rollup.demo.js @@ -20,8 +20,8 @@ export default { "d3-interpolate": "d3Interpolate", "d3-axis": "d3Axis", "d3-array": "d3Array", - "d3-hierarchy": "d3Hierarchy", - }, + "d3-hierarchy": "d3Hierarchy" + } }, plugins: [resolve(), commonjs(), json(), terser()], onwarn(warning, next) { @@ -39,5 +39,5 @@ export default { next(warning); }, - external: ["@carbon/charts"], + external: ["@carbon/charts"] }; diff --git a/packages/core/src/axis-chart.ts b/packages/core/src/axis-chart.ts index 908f5e15a8..1f5a32b45f 100644 --- a/packages/core/src/axis-chart.ts +++ b/packages/core/src/axis-chart.ts @@ -5,7 +5,7 @@ import { LegendOrientations, LegendPositions, ChartConfig, - AxisChartOptions, + AxisChartOptions } from "./interfaces/index"; import { LayoutComponent, @@ -13,7 +13,7 @@ import { Title, Tooltip, TooltipBar, - Spacer, + Spacer } from "./components/index"; import { Tools } from "./tools"; @@ -22,7 +22,7 @@ import { CartesianScales, Curves } from "./services/index"; export class AxisChart extends Chart { services: any = Object.assign(this.services, { cartesianScales: CartesianScales, - curves: Curves, + curves: Curves }); constructor(holder: Element, chartConfigs: ChartConfig) { @@ -35,8 +35,8 @@ export class AxisChart extends Chart { components: [new Title(this.model, this.services)], growth: { x: LayoutGrowth.PREFERRED, - y: LayoutGrowth.FIXED, - }, + y: LayoutGrowth.FIXED + } }; const legendComponent = { @@ -44,8 +44,8 @@ export class AxisChart extends Chart { components: [new Legend(this.model, this.services)], growth: { x: LayoutGrowth.PREFERRED, - y: LayoutGrowth.FIXED, - }, + y: LayoutGrowth.FIXED + } }; const graphFrameComponent = { @@ -53,8 +53,8 @@ export class AxisChart extends Chart { components: graphFrameComponents, growth: { x: LayoutGrowth.STRETCH, - y: LayoutGrowth.FIXED, - }, + y: LayoutGrowth.FIXED + } }; const isLegendEnabled = @@ -92,8 +92,8 @@ export class AxisChart extends Chart { components: [new Spacer(this.model, this.services)], growth: { x: LayoutGrowth.PREFERRED, - y: LayoutGrowth.FIXED, - }, + y: LayoutGrowth.FIXED + } }; const fullFrameComponent = { @@ -105,17 +105,17 @@ export class AxisChart extends Chart { [ ...(isLegendEnabled ? [legendComponent] : []), legendSpacerComponent, - graphFrameComponent, + graphFrameComponent ], { - direction: fullFrameComponentDirection, + direction: fullFrameComponentDirection } - ), + ) ], growth: { x: LayoutGrowth.STRETCH, - y: LayoutGrowth.FIXED, - }, + y: LayoutGrowth.FIXED + } }; // Add chart title if it exists @@ -128,8 +128,8 @@ export class AxisChart extends Chart { components: [new Spacer(this.model, this.services)], growth: { x: LayoutGrowth.PREFERRED, - y: LayoutGrowth.FIXED, - }, + y: LayoutGrowth.FIXED + } }; topLevelLayoutComponents.push(titleSpacerComponent); @@ -142,9 +142,9 @@ export class AxisChart extends Chart { this.services, topLevelLayoutComponents, { - direction: LayoutDirection.COLUMN, + direction: LayoutDirection.COLUMN } - ), + ) ]; } } diff --git a/packages/core/src/charts/area-stacked.ts b/packages/core/src/charts/area-stacked.ts index 35e3f6f2ed..696528750c 100644 --- a/packages/core/src/charts/area-stacked.ts +++ b/packages/core/src/charts/area-stacked.ts @@ -12,7 +12,7 @@ import { Line, StackedScatter, Ruler, - TooltipScatter, + TooltipScatter } from "../components/index"; export class StackedAreaChart extends AxisChart { @@ -43,8 +43,8 @@ export class StackedAreaChart extends AxisChart { new StackedScatter(this.model, this.services, { fadeInOnChartHolderMouseover: true, handleThresholds: true, - stacked: true, - }), + stacked: true + }) ]; const components: any[] = this.getAxisChartComponents( diff --git a/packages/core/src/charts/area.ts b/packages/core/src/charts/area.ts index e2e89e2078..19569398b7 100644 --- a/packages/core/src/charts/area.ts +++ b/packages/core/src/charts/area.ts @@ -16,7 +16,7 @@ import { Tooltip, Legend, LayoutComponent, - TooltipScatter, + TooltipScatter } from "../components/index"; export class AreaChart extends AxisChart { @@ -46,8 +46,8 @@ export class AreaChart extends AxisChart { new Area(this.model, this.services), new Scatter(this.model, this.services, { fadeInOnChartHolderMouseover: true, - handleThresholds: true, - }), + handleThresholds: true + }) ]; const components: any[] = this.getAxisChartComponents( diff --git a/packages/core/src/charts/bar-grouped.ts b/packages/core/src/charts/bar-grouped.ts index ba455e849d..ec3dfde6bc 100644 --- a/packages/core/src/charts/bar-grouped.ts +++ b/packages/core/src/charts/bar-grouped.ts @@ -16,7 +16,7 @@ import { Tooltip, Legend, LayoutComponent, - Skeleton, + Skeleton } from "../components/index"; export class GroupedBarChart extends AxisChart { @@ -44,8 +44,8 @@ export class GroupedBarChart extends AxisChart { new GroupedBar(this.model, this.services), new ZeroLine(this.model, this.services), new Skeleton(this.model, this.services, { - skeleton: Skeletons.VERT_OR_HORIZ, - }), + skeleton: Skeletons.VERT_OR_HORIZ + }) ]; const components: any[] = this.getAxisChartComponents( diff --git a/packages/core/src/charts/bar-simple.ts b/packages/core/src/charts/bar-simple.ts index 85c7998cce..c45a34b025 100644 --- a/packages/core/src/charts/bar-simple.ts +++ b/packages/core/src/charts/bar-simple.ts @@ -16,7 +16,7 @@ import { Tooltip, Legend, LayoutComponent, - Skeleton, + Skeleton } from "../components/index"; export class SimpleBarChart extends AxisChart { @@ -44,8 +44,8 @@ export class SimpleBarChart extends AxisChart { new SimpleBar(this.model, this.services), new ZeroLine(this.model, this.services), new Skeleton(this.model, this.services, { - skeleton: Skeletons.VERT_OR_HORIZ, - }), + skeleton: Skeletons.VERT_OR_HORIZ + }) ]; const components: any[] = this.getAxisChartComponents( diff --git a/packages/core/src/charts/bar-stacked.ts b/packages/core/src/charts/bar-stacked.ts index 70f1fa7512..f8db35c255 100644 --- a/packages/core/src/charts/bar-stacked.ts +++ b/packages/core/src/charts/bar-stacked.ts @@ -15,7 +15,7 @@ import { Legend, LayoutComponent, TooltipBar, - Skeleton, + Skeleton } from "../components/index"; export class StackedBarChart extends AxisChart { @@ -45,8 +45,8 @@ export class StackedBarChart extends AxisChart { new Grid(this.model, this.services), new StackedBar(this.model, this.services), new Skeleton(this.model, this.services, { - skeleton: Skeletons.VERT_OR_HORIZ, - }), + skeleton: Skeletons.VERT_OR_HORIZ + }) ]; const components: any[] = this.getAxisChartComponents( diff --git a/packages/core/src/charts/bubble.ts b/packages/core/src/charts/bubble.ts index 61d164bf1c..a9bbee7385 100644 --- a/packages/core/src/charts/bubble.ts +++ b/packages/core/src/charts/bubble.ts @@ -16,7 +16,7 @@ import { Legend, LayoutComponent, TooltipScatter, - Skeleton, + Skeleton } from "../components/index"; export class BubbleChart extends AxisChart { @@ -47,8 +47,8 @@ export class BubbleChart extends AxisChart { new Ruler(this.model, this.services), new Bubble(this.model, this.services), new Skeleton(this.model, this.services, { - skeleton: Skeletons.GRID, - }), + skeleton: Skeletons.GRID + }) ]; const components: any[] = this.getAxisChartComponents( diff --git a/packages/core/src/charts/donut.ts b/packages/core/src/charts/donut.ts index 3a311f3332..6e8753cd02 100644 --- a/packages/core/src/charts/donut.ts +++ b/packages/core/src/charts/donut.ts @@ -12,7 +12,7 @@ import { Legend, LayoutComponent, Skeleton, - TooltipPie, + TooltipPie } from "../components/index"; export class DonutChart extends PieChart { @@ -37,8 +37,8 @@ export class DonutChart extends PieChart { const graphFrameComponents = [ new Donut(this.model, this.services), new Skeleton(this.model, this.services, { - skeleton: Skeletons.DONUT, - }), + skeleton: Skeletons.DONUT + }) ]; const components: any[] = this.getChartComponents(graphFrameComponents); diff --git a/packages/core/src/charts/gauge.ts b/packages/core/src/charts/gauge.ts index 0956c60bbf..612082082b 100644 --- a/packages/core/src/charts/gauge.ts +++ b/packages/core/src/charts/gauge.ts @@ -5,10 +5,7 @@ import { ChartConfig, GaugeChartOptions } from "../interfaces/index"; import { Tools } from "../tools"; // Components -import { - Gauge, - Tooltip -} from "../components/index"; +import { Gauge, Tooltip } from "../components/index"; export class GaugeChart extends Chart { constructor(holder: Element, chartConfigs: ChartConfig) { diff --git a/packages/core/src/charts/line.ts b/packages/core/src/charts/line.ts index 992adffa82..c2176eb5f0 100644 --- a/packages/core/src/charts/line.ts +++ b/packages/core/src/charts/line.ts @@ -17,7 +17,7 @@ import { Legend, LayoutComponent, TooltipScatter, - Skeleton, + Skeleton } from "../components/index"; export class LineChart extends AxisChart { @@ -46,8 +46,8 @@ export class LineChart extends AxisChart { new Line(this.model, this.services), new Scatter(this.model, this.services, { handleThresholds: true }), new Skeleton(this.model, this.services, { - skeleton: Skeletons.GRID, - }), + skeleton: Skeletons.GRID + }) ]; const components: any[] = this.getAxisChartComponents( diff --git a/packages/core/src/charts/pie.ts b/packages/core/src/charts/pie.ts index dc870fb7b7..7b985c09c7 100644 --- a/packages/core/src/charts/pie.ts +++ b/packages/core/src/charts/pie.ts @@ -13,7 +13,7 @@ import { TooltipPie, Legend, LayoutComponent, - Skeleton, + Skeleton } from "../components/index"; export class PieChart extends Chart { @@ -50,8 +50,8 @@ export class PieChart extends Chart { const graphFrameComponents = [ new Pie(this.model, this.services), new Skeleton(this.model, this.services, { - skeleton: Skeletons.PIE, - }), + skeleton: Skeletons.PIE + }) ]; // get the base chart components and export with tooltip diff --git a/packages/core/src/charts/radar.ts b/packages/core/src/charts/radar.ts index 89b421f84d..70c8b7817c 100644 --- a/packages/core/src/charts/radar.ts +++ b/packages/core/src/charts/radar.ts @@ -9,7 +9,7 @@ import { // the imports below are needed because of typescript bug (error TS4029) Legend, LayoutComponent, - TooltipRadar, + TooltipRadar } from "../components/index"; import { Radar } from "../components/graphs/radar"; diff --git a/packages/core/src/charts/scatter.ts b/packages/core/src/charts/scatter.ts index c558fcc1f0..d57d340451 100644 --- a/packages/core/src/charts/scatter.ts +++ b/packages/core/src/charts/scatter.ts @@ -16,7 +16,7 @@ import { Legend, LayoutComponent, TooltipScatter, - Skeleton, + Skeleton } from "../components/index"; export class ScatterChart extends AxisChart { @@ -47,8 +47,8 @@ export class ScatterChart extends AxisChart { new Ruler(this.model, this.services), new Scatter(this.model, this.services), new Skeleton(this.model, this.services, { - skeleton: Skeletons.GRID, - }), + skeleton: Skeletons.GRID + }) ]; const components: any[] = this.getAxisChartComponents( diff --git a/packages/core/src/components/axes/grid.ts b/packages/core/src/components/axes/grid.ts index 5ff55f030b..9fabb340cf 100644 --- a/packages/core/src/components/axes/grid.ts +++ b/packages/core/src/components/axes/grid.ts @@ -177,7 +177,7 @@ export class Grid extends Component { // threshold for when to display a gridline tooltip const bounds = { min: Number(translations.tx) - threshold, - max: Number(translations.tx) + threshold, + max: Number(translations.tx) + threshold }; return bounds.min <= position[0] && position[0] <= bounds.max; diff --git a/packages/core/src/components/axes/ruler.ts b/packages/core/src/components/axes/ruler.ts index 5343b721eb..1b2e98da92 100644 --- a/packages/core/src/components/axes/ruler.ts +++ b/packages/core/src/components/axes/ruler.ts @@ -44,7 +44,7 @@ export class Ruler extends Component { originalData: any; }[] = displayData.map((d) => ({ domainValue: this.services.cartesianScales.getDomainValue(d), - originalData: d, + originalData: d })); /** @@ -129,7 +129,7 @@ export class Ruler extends Component { this.services.events.dispatchEvent("show-tooltip", { hoveredElement: rulerLine, multidata: tooltipData, - type: TooltipTypes.GRIDLINE, + type: TooltipTypes.GRIDLINE }); ruler.attr("opacity", 1); diff --git a/packages/core/src/components/axes/two-dimensional-axes.ts b/packages/core/src/components/axes/two-dimensional-axes.ts index adeeca9e34..ec843b20ab 100644 --- a/packages/core/src/components/axes/two-dimensional-axes.ts +++ b/packages/core/src/components/axes/two-dimensional-axes.ts @@ -17,7 +17,7 @@ export class TwoDimensionalAxes extends Component { top: 0, right: 0, bottom: 0, - left: 0, + left: 0 }; render(animate = false) { @@ -44,7 +44,7 @@ export class TwoDimensionalAxes extends Component { const axisComponent = new Axis(this.model, this.services, { position: axisPosition, axes: this.configs.axes, - margins: this.margins, + margins: this.margins }); // Set model, services & parent for the new axis component @@ -75,7 +75,7 @@ export class TwoDimensionalAxes extends Component { const invisibleAxisRef = child.getInvisibleAxisRef(); const { width, - height, + height } = DOMUtils.getSVGElementSize(invisibleAxisRef, { useBBox: true }); let offset; @@ -83,7 +83,7 @@ export class TwoDimensionalAxes extends Component { offset = 0; } else { offset = DOMUtils.getSVGElementSize(child.getTitleRef(), { - useBBox: true, + useBBox: true }).height; } diff --git a/packages/core/src/components/axes/zero-line.ts b/packages/core/src/components/axes/zero-line.ts index 93a7f5b6f4..5a69104a58 100644 --- a/packages/core/src/components/axes/zero-line.ts +++ b/packages/core/src/components/axes/zero-line.ts @@ -9,7 +9,7 @@ export class ZeroLine extends Component { render(animate: boolean) { const [ minDomainValue, - maxDomainValue, + maxDomainValue ] = this.services.cartesianScales.getRangeScale().domain(); const drawZeroLine = (minDomainValue > 0 && maxDomainValue < 0) || @@ -43,7 +43,7 @@ export class ZeroLine extends Component { x0, x1, y0: yPosition, - y1: yPosition, + y1: yPosition }, this.services.cartesianScales.getOrientation() ); diff --git a/packages/core/src/components/essentials/legend.ts b/packages/core/src/components/essentials/legend.ts index bc5f2d8c3a..eed36dd2f1 100644 --- a/packages/core/src/components/essentials/legend.ts +++ b/packages/core/src/components/essentials/legend.ts @@ -2,7 +2,13 @@ import * as Configuration from "../../configuration"; import { Component } from "../component"; import { Tools } from "../../tools"; -import { LegendOrientations, Roles, Events, TooltipTypes, TruncationTypes } from "../../interfaces"; +import { + LegendOrientations, + Roles, + Events, + TooltipTypes, + TruncationTypes +} from "../../interfaces"; import { DOMUtils } from "../../services"; // D3 Imports @@ -72,17 +78,19 @@ export class Legend extends Component { // truncate the legend label if it's too long if (truncationType !== TruncationTypes.NONE) { - addedLegendItemsText - .html(function(d) { - if (d.name.length > truncationThreshold) { - return Tools.truncateLabel(d.name, truncationType, truncationNumCharacter); - } else { - return d.name; - } - }); + addedLegendItemsText.html(function (d) { + if (d.name.length > truncationThreshold) { + return Tools.truncateLabel( + d.name, + truncationType, + truncationNumCharacter + ); + } else { + return d.name; + } + }); } else { - addedLegendItemsText - .html((d) => d.name); + addedLegendItemsText.html((d) => d.name); } this.breakItemsIntoLines(addedLegendItems); @@ -268,7 +276,7 @@ export class Legend extends Component { svg.selectAll("g.legend-item") .on("mouseover", function () { self.services.events.dispatchEvent(Events.Legend.ITEM_HOVER, { - hoveredElement: select(this), + hoveredElement: select(this) }); // Configs @@ -298,7 +306,7 @@ export class Legend extends Component { }) .on("click", function () { self.services.events.dispatchEvent(Events.Legend.ITEM_CLICK, { - clickedElement: select(this), + clickedElement: select(this) }); const clickedItem = select(this); @@ -311,9 +319,9 @@ export class Legend extends Component { const hoveredItemData = hoveredItem.datum() as any; if (hoveredItemData.name.length > truncationThreshold) { self.services.events.dispatchEvent(Events.Tooltip.SHOW, { - hoveredElement: hoveredItem, - type: TooltipTypes.LEGEND, - }); + hoveredElement: hoveredItem, + type: TooltipTypes.LEGEND + }); } }) .on("mouseout", function () { @@ -325,7 +333,7 @@ export class Legend extends Component { self.services.events.dispatchEvent( Events.Legend.ITEM_MOUSEOUT, { - hoveredElement: hoveredItem, + hoveredElement: hoveredItem } ); }); diff --git a/packages/core/src/components/essentials/threshold.ts b/packages/core/src/components/essentials/threshold.ts index 2ac4b4a78b..0e175a794a 100644 --- a/packages/core/src/components/essentials/threshold.ts +++ b/packages/core/src/components/essentials/threshold.ts @@ -6,7 +6,7 @@ import { AxisPositions, Events, ScaleTypes, - CartesianOrientations, + CartesianOrientations } from "../../interfaces"; import { select, mouse } from "d3-selection"; @@ -17,7 +17,7 @@ import Position, { PLACEMENTS } from "@carbon/utils-position"; import settings from "carbon-components/es/globals/js/settings"; import { formatTick, - computeTimeIntervalName, + computeTimeIntervalName } from "../../services/time-series"; export class Threshold extends Component { @@ -83,7 +83,7 @@ export class Threshold extends Component { const getRangeValue = (d) => cartesianScales.getRangeValue(d); const [ getXValue, - getYValue, + getYValue ] = Tools.flipDomainAndRangeBasedOnOrientation( getDomainValue, getRangeValue, @@ -157,7 +157,7 @@ export class Threshold extends Component { if (scaleType === ScaleTypes.TIME) { const isVertical = [ AxisPositions.LEFT, - AxisPositions.RIGHT, + AxisPositions.RIGHT ].includes(axisPosition); const mainXScale = this.services.cartesianScales.getMainXScale(); const mainYScale = this.services.cartesianScales.getMainYScale(); @@ -176,7 +176,7 @@ export class Threshold extends Component { value, valueFormatter, fillColor, - label = "Threshold", + label = "Threshold" } = this.configs; const holder = select(this.services.domUtils.getHolder()); // Format the threshold value using valueFormatter if defined in user-provided options @@ -203,18 +203,18 @@ export class Threshold extends Component { const bestPlacementOption = this.positionService.findBestPlacementAt( { left: mouseRelativePos[0], - top: mouseRelativePos[1], + top: mouseRelativePos[1] }, target, [ PLACEMENTS.RIGHT, PLACEMENTS.LEFT, PLACEMENTS.TOP, - PLACEMENTS.BOTTOM, + PLACEMENTS.BOTTOM ], () => ({ width: holder.offsetWidth, - height: holder.offsetHeight, + height: holder.offsetHeight }) ); @@ -222,7 +222,7 @@ export class Threshold extends Component { const pos = this.positionService.findPositionAt( { left: mouseRelativePos[0], - top: mouseRelativePos[1], + top: mouseRelativePos[1] }, target, bestPlacementOption @@ -239,13 +239,13 @@ export class Threshold extends Component { .on("mouseover mousemove", function () { self.threshold.classed("active", true); self.services.events.dispatchEvent(Events.Threshold.SHOW, { - hoveredElement: select(self.threshold), + hoveredElement: select(self.threshold) }); }) .on("mouseout", function () { self.threshold.classed("active", false); self.services.events.dispatchEvent(Events.Threshold.HIDE, { - hoveredElement: select(self.threshold), + hoveredElement: select(self.threshold) }); }); } diff --git a/packages/core/src/components/essentials/title.ts b/packages/core/src/components/essentials/title.ts index 7259c2ba26..01ec8926dd 100644 --- a/packages/core/src/components/essentials/title.ts +++ b/packages/core/src/components/essentials/title.ts @@ -55,12 +55,12 @@ export class Title extends Component { .on("mouseenter", function () { self.services.events.dispatchEvent(Events.Tooltip.SHOW, { hoveredElement: title, - type: TooltipTypes.TITLE, + type: TooltipTypes.TITLE }); }) .on("mouseout", function () { self.services.events.dispatchEvent(Events.Tooltip.HIDE, { - hoveredElement: title, + hoveredElement: title }); }); } diff --git a/packages/core/src/components/essentials/tooltip-bar.ts b/packages/core/src/components/essentials/tooltip-bar.ts index a868b82a3d..3b396b3d90 100644 --- a/packages/core/src/components/essentials/tooltip-bar.ts +++ b/packages/core/src/components/essentials/tooltip-bar.ts @@ -5,7 +5,7 @@ import { TooltipPosition, TooltipTypes, CartesianOrientations, - Events, + Events } from "./../../interfaces"; // import the settings for the css prefix @@ -53,8 +53,8 @@ export class TooltipBar extends Tooltip { "gridline", "enabled" )) || - (e.detail.type === TooltipTypes.LEGEND) || - (e.detail.type === TooltipTypes.AXISLABEL) + e.detail.type === TooltipTypes.LEGEND || + e.detail.type === TooltipTypes.AXISLABEL ) { let data = e.detail.hoveredElement.datum() as any; const hoveredElement = e.detail.hoveredElement.node(); @@ -91,12 +91,20 @@ export class TooltipBar extends Tooltip { // default tooltip tooltipTextContainer.html(defaultHTML); } - if ((e.detail.type === TooltipTypes.LEGEND) || (e.detail.type === TooltipTypes.AXISLABEL)) { + if ( + e.detail.type === TooltipTypes.LEGEND || + e.detail.type === TooltipTypes.AXISLABEL + ) { this.positionTooltip(); } else { - const position = this.getTooltipPosition(hoveredElement, data); + const position = this.getTooltipPosition( + hoveredElement, + data + ); // Position the tooltip relative to the bars - this.positionTooltip(e.detail.multidata ? undefined : position); + this.positionTooltip( + e.detail.multidata ? undefined : position + ); } } else if (e.detail.type === TooltipTypes.TITLE) { // use the chart size to enforce a max width on the tooltip @@ -165,7 +173,7 @@ export class TooltipBar extends Tooltip { barPosition.left - holderPosition.left + barPosition.width / 2, - top: barPosition.bottom - holderPosition.top + verticalOffset, + top: barPosition.bottom - holderPosition.top + verticalOffset }; return { placement: TooltipPosition.BOTTOM, position: tooltipPos }; @@ -176,7 +184,7 @@ export class TooltipBar extends Tooltip { barPosition.left - holderPosition.left + barPosition.width / 2, - top: barPosition.top - holderPosition.top - verticalOffset, + top: barPosition.top - holderPosition.top - verticalOffset }; return { placement: TooltipPosition.TOP, position: tooltipPos }; diff --git a/packages/core/src/components/essentials/tooltip.ts b/packages/core/src/components/essentials/tooltip.ts index 73e5c845cb..6977d8ca34 100644 --- a/packages/core/src/components/essentials/tooltip.ts +++ b/packages/core/src/components/essentials/tooltip.ts @@ -64,8 +64,8 @@ export class Tooltip extends Component { "gridline", "enabled" )) || - (e.detail.type === TooltipTypes.LEGEND) || - (e.detail.type === TooltipTypes.AXISLABEL) + e.detail.type === TooltipTypes.LEGEND || + e.detail.type === TooltipTypes.AXISLABEL ) { let data = select(event.target).datum() as any; @@ -74,12 +74,12 @@ export class Tooltip extends Component { if (e.detail.multidata) { // multi tooltip data = e.detail.multidata; - defaultHTML = this.getMultilineTooltipHTML(data, e.detail.type); - } else { - defaultHTML = this.getTooltipHTML( + defaultHTML = this.getMultilineTooltipHTML( data, e.detail.type ); + } else { + defaultHTML = this.getTooltipHTML(data, e.detail.type); } // if there is a provided tooltip HTML function call it @@ -238,7 +238,7 @@ export class Tooltip extends Component { elementPosition.left - holderPosition.left + elementPosition.width / 2, - top: elementPosition.top - holderPosition.top - verticalOffset, + top: elementPosition.top - holderPosition.top - verticalOffset }; return { placement: TooltipPosition.BOTTOM, position: tooltipPos }; @@ -268,23 +268,23 @@ export class Tooltip extends Component { const bestPlacementOption = this.positionService.findBestPlacementAt( { left: mouseRelativePos[0], - top: mouseRelativePos[1], + top: mouseRelativePos[1] }, target, [ PLACEMENTS.RIGHT, PLACEMENTS.LEFT, PLACEMENTS.TOP, - PLACEMENTS.BOTTOM, + PLACEMENTS.BOTTOM ], () => ({ width: holder.offsetWidth, - height: holder.offsetHeight, + height: holder.offsetHeight }) ); let { - horizontalOffset, + horizontalOffset } = this.model.getOptions().tooltip.datapoint; if (bestPlacementOption === PLACEMENTS.LEFT) { horizontalOffset *= -1; @@ -294,7 +294,7 @@ export class Tooltip extends Component { pos = this.positionService.findPositionAt( { left: mouseRelativePos[0] + horizontalOffset, - top: mouseRelativePos[1], + top: mouseRelativePos[1] }, target, bestPlacementOption diff --git a/packages/core/src/components/graphs/area-stacked.ts b/packages/core/src/components/graphs/area-stacked.ts index 7ac43aa215..7b9ec0fa69 100644 --- a/packages/core/src/components/graphs/area-stacked.ts +++ b/packages/core/src/components/graphs/area-stacked.ts @@ -47,8 +47,8 @@ export class StackedArea extends Component { return; } - const percentage = Object.keys(options.axes).some(axis => - options.axes[axis].percentage + const percentage = Object.keys(options.axes).some( + (axis) => options.axes[axis].percentage ); const stackedData = this.model.getStackedData({ percentage }); diff --git a/packages/core/src/components/graphs/bar-grouped.ts b/packages/core/src/components/graphs/bar-grouped.ts index ba40e5c083..b087d3a4d7 100644 --- a/packages/core/src/components/graphs/bar-grouped.ts +++ b/packages/core/src/components/graphs/bar-grouped.ts @@ -5,7 +5,7 @@ import { CartesianOrientations, Events, Roles, - TooltipTypes, + TooltipTypes } from "../../interfaces"; // D3 Imports @@ -194,27 +194,27 @@ export class GroupedBar extends Bar { // Dispatch mouse event self.services.events.dispatchEvent(Events.Bar.BAR_MOUSEOVER, { element: hoveredElement, - datum, + datum }); // Show tooltip self.services.events.dispatchEvent(Events.Tooltip.SHOW, { hoveredElement, - type: TooltipTypes.DATAPOINT, + type: TooltipTypes.DATAPOINT }); }) .on("mousemove", function (datum) { // Dispatch mouse event self.services.events.dispatchEvent(Events.Bar.BAR_MOUSEMOVE, { element: select(this), - datum, + datum }); }) .on("click", function (datum) { // Dispatch mouse event self.services.events.dispatchEvent(Events.Bar.BAR_CLICK, { element: select(this), - datum, + datum }); }) .on("mouseout", function (datum) { @@ -235,12 +235,12 @@ export class GroupedBar extends Bar { // Dispatch mouse event self.services.events.dispatchEvent(Events.Bar.BAR_MOUSEOUT, { element: hoveredElement, - datum, + datum }); // Hide tooltip self.services.events.dispatchEvent(Events.Tooltip.HIDE, { - hoveredElement, + hoveredElement }); }); } diff --git a/packages/core/src/components/graphs/bar-simple.ts b/packages/core/src/components/graphs/bar-simple.ts index 049a2b1b33..28fc16633a 100644 --- a/packages/core/src/components/graphs/bar-simple.ts +++ b/packages/core/src/components/graphs/bar-simple.ts @@ -137,26 +137,26 @@ export class SimpleBar extends Bar { // Dispatch mouse event self.services.events.dispatchEvent(Events.Bar.BAR_MOUSEOVER, { element: hoveredElement, - datum, + datum }); self.services.events.dispatchEvent(Events.Tooltip.SHOW, { hoveredElement, - type: TooltipTypes.DATAPOINT, + type: TooltipTypes.DATAPOINT }); }) .on("mousemove", function (datum) { // Dispatch mouse event self.services.events.dispatchEvent(Events.Bar.BAR_MOUSEMOVE, { element: select(this), - datum, + datum }); }) .on("click", function (datum) { // Dispatch mouse event self.services.events.dispatchEvent(Events.Bar.BAR_CLICK, { element: select(this), - datum, + datum }); }) .on("mouseout", function (datum) { @@ -176,12 +176,12 @@ export class SimpleBar extends Bar { // Dispatch mouse event self.services.events.dispatchEvent(Events.Bar.BAR_MOUSEOUT, { element: hoveredElement, - datum, + datum }); // Hide tooltip self.services.events.dispatchEvent(Events.Tooltip.HIDE, { - hoveredElement, + hoveredElement }); }); } diff --git a/packages/core/src/components/graphs/bar-stacked.ts b/packages/core/src/components/graphs/bar-stacked.ts index 811690bc73..ff8ead07b7 100644 --- a/packages/core/src/components/graphs/bar-stacked.ts +++ b/packages/core/src/components/graphs/bar-stacked.ts @@ -5,7 +5,7 @@ import { Roles, TooltipTypes, Events, - CartesianOrientations, + CartesianOrientations } from "../../interfaces"; // D3 Imports @@ -182,7 +182,7 @@ export class StackedBar extends Bar { // Dispatch mouse event self.services.events.dispatchEvent(Events.Bar.BAR_MOUSEOVER, { element: hoveredElement, - datum, + datum }); }) .on("mousemove", function (datum) { @@ -206,7 +206,7 @@ export class StackedBar extends Bar { matchingDataPoint = { [domainIdentifier]: datum.data.sharedStackKey, [rangeIdentifier]: datum.data[datum.group], - [groupMapsTo]: datum.group, + [groupMapsTo]: datum.group }; } @@ -214,14 +214,14 @@ export class StackedBar extends Bar { self.services.events.dispatchEvent(Events.Tooltip.SHOW, { hoveredElement, data: matchingDataPoint, - type: TooltipTypes.DATAPOINT, + type: TooltipTypes.DATAPOINT }); }) .on("click", function (datum) { // Dispatch mouse event self.services.events.dispatchEvent(Events.Bar.BAR_CLICK, { element: select(this), - datum, + datum }); }) .on("mouseout", function (datum) { @@ -241,12 +241,12 @@ export class StackedBar extends Bar { // Dispatch mouse event self.services.events.dispatchEvent(Events.Bar.BAR_MOUSEOUT, { element: hoveredElement, - datum, + datum }); // Hide tooltip self.services.events.dispatchEvent(Events.Tooltip.HIDE, { - hoveredElement, + hoveredElement }); }); } diff --git a/packages/core/src/components/graphs/gauge.ts b/packages/core/src/components/graphs/gauge.ts index d465e223d0..376877d1c5 100644 --- a/packages/core/src/components/graphs/gauge.ts +++ b/packages/core/src/components/graphs/gauge.ts @@ -1,12 +1,7 @@ // Internal Imports import { Component } from "../component"; import { DOMUtils } from "../../services"; -import { - Roles, - Events, - GaugeTypes, - ArrowDirections -} from "../../interfaces"; +import { Roles, Events, GaugeTypes, ArrowDirections } from "../../interfaces"; import { Tools } from "../../tools"; // D3 Imports @@ -253,13 +248,16 @@ export class Gauge extends Component { : () => 0; // use numberFormatter here only if there is a delta supplied - const numberFormatter = delta ? Tools.getProperty( + const numberFormatter = delta + ? Tools.getProperty(options, "gauge", "numberFormatter") + : () => null; + + const arrowSize = Tools.getProperty( options, "gauge", - "numberFormatter" - ) : () => null; - - const arrowSize = Tools.getProperty(options, "gauge", "deltaArrow", "size"); + "deltaArrow", + "size" + ); const numberSpacing = Tools.getProperty( options, "gauge", @@ -277,10 +275,12 @@ export class Gauge extends Component { `translate(0, ${deltaFontSize(radius) + numberSpacing})` ); - const deltaNumber = DOMUtils.appendOrSelect(deltaGroup, "text.gauge-delta-number"); + const deltaNumber = DOMUtils.appendOrSelect( + deltaGroup, + "text.gauge-delta-number" + ); - deltaNumber - .data(delta === null ? [] : [delta]); + deltaNumber.data(delta === null ? [] : [delta]); deltaNumber .enter() @@ -300,7 +300,12 @@ export class Gauge extends Component { ); // check if delta arrow is disabled - const arrowEnabled = Tools.getProperty(options, "gauge", "deltaArrow", "enabled"); + const arrowEnabled = Tools.getProperty( + options, + "gauge", + "deltaArrow", + "enabled" + ); const deltaArrow = deltaGroup .selectAll("svg.gauge-delta-arrow") .data(delta !== null && arrowEnabled ? [delta] : []); diff --git a/packages/core/src/components/graphs/line.ts b/packages/core/src/components/graphs/line.ts index f8057531f5..2d2c5c36c7 100644 --- a/packages/core/src/components/graphs/line.ts +++ b/packages/core/src/components/graphs/line.ts @@ -56,8 +56,8 @@ export class Line extends Component { let data = []; if (this.configs.stacked) { - const percentage = Object.keys(options.axes).some(axis => - options.axes[axis].percentage + const percentage = Object.keys(options.axes).some( + (axis) => options.axes[axis].percentage ); const { groupMapsTo } = options.data; const stackedData = this.model.getStackedData({ percentage }); diff --git a/packages/core/src/components/graphs/pie.ts b/packages/core/src/components/graphs/pie.ts index 5cbeb88578..7f5d37d060 100644 --- a/packages/core/src/components/graphs/pie.ts +++ b/packages/core/src/components/graphs/pie.ts @@ -6,7 +6,7 @@ import { CalloutDirections, Roles, TooltipTypes, - Events, + Events } from "../../interfaces"; // D3 Imports @@ -269,13 +269,13 @@ export class Pie extends Component { if (direction === CalloutDirections.RIGHT) { d.startPos = { x: xPosition, - y: yPosition + d.textOffsetY, + y: yPosition + d.textOffsetY }; // end position for the callout line d.endPos = { x: xPosition + options.pie.callout.offsetX, - y: yPosition - options.pie.callout.offsetY + d.textOffsetY, + y: yPosition - options.pie.callout.offsetY + d.textOffsetY }; // the intersection point of the vertical and horizontal line @@ -285,13 +285,13 @@ export class Pie extends Component { // start position for the callout line d.startPos = { x: xPosition, - y: yPosition + d.textOffsetY, + y: yPosition + d.textOffsetY }; // end position for the callout line should be bottom aligned to the title d.endPos = { x: xPosition - options.pie.callout.offsetX, - y: yPosition - options.pie.callout.offsetY + d.textOffsetY, + y: yPosition - options.pie.callout.offsetY + d.textOffsetY }; // the intersection point of the vertical and horizontal line @@ -369,7 +369,7 @@ export class Pie extends Component { // Dispatch mouse event self.services.events.dispatchEvent(Events.Pie.SLICE_MOUSEOVER, { element: select(this), - datum, + datum }); }) .on("mousemove", function (datum) { @@ -387,20 +387,20 @@ export class Pie extends Component { // Dispatch mouse event self.services.events.dispatchEvent(Events.Pie.SLICE_MOUSEMOVE, { element: hoveredElement, - datum, + datum }); // Show tooltip self.services.events.dispatchEvent(Events.Tooltip.SHOW, { hoveredElement, - type: TooltipTypes.DATAPOINT, + type: TooltipTypes.DATAPOINT }); }) .on("click", function (datum) { // Dispatch mouse event self.services.events.dispatchEvent(Events.Pie.SLICE_CLICK, { element: select(this), - datum, + datum }); }) .on("mouseout", function (datum) { @@ -417,12 +417,12 @@ export class Pie extends Component { // Dispatch mouse event self.services.events.dispatchEvent(Events.Pie.SLICE_MOUSEOUT, { element: hoveredElement, - datum, + datum }); // Hide tooltip self.services.events.dispatchEvent(Events.Tooltip.HIDE, { - hoveredElement, + hoveredElement }); }); } @@ -432,7 +432,7 @@ export class Pie extends Component { const options = this.model.getOptions(); const { width, height } = DOMUtils.getSVGElementSize(this.parent, { - useAttrs: true, + useAttrs: true }); const radius: number = Math.min(width, height) / 2; diff --git a/packages/core/src/components/graphs/radar.ts b/packages/core/src/components/graphs/radar.ts index 7c42f8e098..7e48d650fa 100644 --- a/packages/core/src/components/graphs/radar.ts +++ b/packages/core/src/components/graphs/radar.ts @@ -9,7 +9,7 @@ import { radialLabelPlacement, radToDeg, polarToCartesianCoords, - distanceBetweenPointOnCircAndVerticalDiameter, + distanceBetweenPointOnCircAndVerticalDiameter } from "../../services/angle-utils"; // D3 Imports @@ -47,7 +47,7 @@ export class Radar extends Component { render(animate = true) { this.svg = this.getContainerSVG(); const { width, height } = DOMUtils.getSVGElementSize(this.parent, { - useAttrs: true, + useAttrs: true }); const data = this.model.getData(); @@ -62,7 +62,7 @@ export class Radar extends Component { yTicksNumber, minRange, xAxisRectHeight, - opacity, + opacity } = Tools.getProperty(options, "radar"); this.uniqueKeys = Array.from(new Set(data.map((d) => d[angle]))); @@ -93,9 +93,7 @@ export class Radar extends Component { const yScale = scaleLinear() .domain([ 0, - max( - this.displayDataNormalized.map((d) => d[value]) as number[] - ), + max(this.displayDataNormalized.map((d) => d[value]) as number[]) ]) .range([minRange, radius]) .nice(yTicksNumber); @@ -135,7 +133,7 @@ export class Radar extends Component { // center coordinates const c: Point = { x: leftPadding + xLabelPadding, - y: height / 2, + y: height / 2 }; ///////////////////////////// @@ -682,7 +680,7 @@ export class Radar extends Component { return this.uniqueGroups.map((group) => ({ [angle]: key, [groupMapsTo]: group, - [value]: null, + [value]: null })); }) ); @@ -699,7 +697,7 @@ export class Radar extends Component { const completeBlankData = this.uniqueKeys.map((k) => ({ [groupMapsTo]: name, [angle]: k, - [value]: null, + [value]: null })); return { name, data: Tools.merge(completeBlankData, data) }; }); @@ -762,7 +760,7 @@ export class Radar extends Component { const self = this; const { axes: { angle }, - dotsRadius, + dotsRadius } = Tools.getProperty(this.model.getOptions(), "radar"); // events on x axes rects @@ -774,7 +772,7 @@ export class Radar extends Component { Events.Radar.X_AXIS_MOUSEOVER, { element: select(this), - datum, + datum } ); }) @@ -800,7 +798,7 @@ export class Radar extends Component { Events.Radar.X_AXIS_MOUSEMOVE, { element: hoveredElement, - datum, + datum } ); @@ -813,14 +811,14 @@ export class Radar extends Component { self.services.events.dispatchEvent(Events.Tooltip.SHOW, { hoveredElement, multidata: itemsToHighlight, - type: TooltipTypes.GRIDLINE, + type: TooltipTypes.GRIDLINE }); }) .on("click", function (datum) { // Dispatch mouse event self.services.events.dispatchEvent(Events.Radar.X_AXIS_CLICK, { element: select(this), - datum, + datum }); }) .on("mouseout", function (datum) { @@ -843,16 +841,16 @@ export class Radar extends Component { Events.Radar.X_AXIS_MOUSEOUT, { element: hoveredElement, - datum, + datum } ); // Hide tooltip self.services.events.dispatchEvent("hide-tooltip", { - hoveredElement, + hoveredElement }); self.services.events.dispatchEvent(Events.Tooltip.HIDE, { - hoveredElement, + hoveredElement }); }); } diff --git a/packages/core/src/components/graphs/scatter-stacked.ts b/packages/core/src/components/graphs/scatter-stacked.ts index d3cdc2e1d7..fd1bf3f829 100644 --- a/packages/core/src/components/graphs/scatter-stacked.ts +++ b/packages/core/src/components/graphs/scatter-stacked.ts @@ -19,9 +19,9 @@ export class StackedScatter extends Scatter { const domainIdentifier = this.services.cartesianScales.getDomainIdentifier(); const rangeIdentifier = this.services.cartesianScales.getRangeIdentifier(); - const percentage = Object.keys(options.axes).some(axis => - options.axes[axis].percentage - ) + const percentage = Object.keys(options.axes).some( + (axis) => options.axes[axis].percentage + ); const stackedData = this.model.getStackedData({ percentage }); // Update data on dot groups @@ -62,7 +62,7 @@ export class StackedScatter extends Scatter { return { [groupMapsTo]: group, [domainIdentifier]: d["data"]["sharedStackKey"], - [rangeIdentifier]: d[1], + [rangeIdentifier]: d[1] }; }); this.styleCircles(circlesToStyle, animate); diff --git a/packages/core/src/components/graphs/scatter.ts b/packages/core/src/components/graphs/scatter.ts index 26466da2bc..3da5e8b47a 100644 --- a/packages/core/src/components/graphs/scatter.ts +++ b/packages/core/src/components/graphs/scatter.ts @@ -50,9 +50,9 @@ export class Scatter extends Component { const { stacked } = this.configs; let scatterData; if (stacked) { - const percentage = Object.keys(options.axes).some(axis => - options.axes[axis].percentage - ) + const percentage = Object.keys(options.axes).some( + (axis) => options.axes[axis].percentage + ); scatterData = this.model.getStackedData({ percentage }); } else { scatterData = this.model @@ -103,7 +103,7 @@ export class Scatter extends Component { // Get highest domain and range thresholds const [ xThreshold, - yThreshold, + yThreshold ] = Tools.flipDomainAndRangeBasedOnOrientation( this.services.cartesianScales.getHighestDomainThreshold(), this.services.cartesianScales.getHighestRangeThreshold(), @@ -112,7 +112,7 @@ export class Scatter extends Component { const [ getXValue, - getYValue, + getYValue ] = Tools.flipDomainAndRangeBasedOnOrientation( (d, i) => cartesianScales.getDomainValue(d, i), (d, i) => cartesianScales.getRangeValue(d, i), @@ -155,7 +155,7 @@ export class Scatter extends Component { const getRangeValue = (d, i) => cartesianScales.getRangeValue(d, i); const [ getXValue, - getYValue, + getYValue ] = Tools.flipDomainAndRangeBasedOnOrientation( getDomainValue, getRangeValue, @@ -320,7 +320,7 @@ export class Scatter extends Component { hoveredElement, multidata: overlappingData.length > 1 ? overlappingData : null, - type: TooltipTypes.DATAPOINT, + type: TooltipTypes.DATAPOINT }); const eventNameToDispatch = @@ -330,7 +330,7 @@ export class Scatter extends Component { // Dispatch mouse event self.services.events.dispatchEvent(eventNameToDispatch, { element: hoveredElement, - datum, + datum }); }) .on("click", function (datum) { @@ -339,7 +339,7 @@ export class Scatter extends Component { Events.Scatter.SCATTER_CLICK, { element: select(this), - datum, + datum } ); }) @@ -356,13 +356,13 @@ export class Scatter extends Component { Events.Scatter.SCATTER_MOUSEOUT, { element: hoveredElement, - datum, + datum } ); // Hide tooltip self.services.events.dispatchEvent(Events.Tooltip.HIDE, { - hoveredElement, + hoveredElement }); }); } diff --git a/packages/core/src/components/graphs/skeleton.ts b/packages/core/src/components/graphs/skeleton.ts index d41c146d10..5e4d0570a9 100644 --- a/packages/core/src/components/graphs/skeleton.ts +++ b/packages/core/src/components/graphs/skeleton.ts @@ -19,7 +19,7 @@ export class Skeleton extends Component { const svg = this.parent; const parent = svg.node().parentNode; const { width, height } = DOMUtils.getSVGElementSize(parent, { - useAttrs: true, + useAttrs: true }); svg.attr("width", width).attr("height", height); @@ -109,7 +109,7 @@ export class Skeleton extends Component { const svg = this.parent; const parent = svg.node().parentNode; const { width, height } = DOMUtils.getSVGElementSize(parent, { - useAttrs: true, + useAttrs: true }); this.backdrop = DOMUtils.appendOrSelect(svg, "svg.chart-skeleton.DAII") @@ -258,7 +258,7 @@ export class Skeleton extends Component { const stopShimmerClass = "stop-shimmer"; const container = this.parent.select(".chart-skeleton"); const { width } = DOMUtils.getSVGElementSize(this.parent, { - useAttrs: true, + useAttrs: true }); const startPoint = 0; const endPoint = width; diff --git a/packages/core/src/components/layout/layout.ts b/packages/core/src/components/layout/layout.ts index cba8a175cf..92e315c2ed 100644 --- a/packages/core/src/components/layout/layout.ts +++ b/packages/core/src/components/layout/layout.ts @@ -4,7 +4,7 @@ import { LayoutDirection, LayoutGrowth, LayoutComponentChild, - LayoutConfigs, + LayoutConfigs } from "../../interfaces/index"; import { Tools } from "../../tools"; import { DOMUtils } from "../../services"; @@ -93,11 +93,11 @@ export class LayoutComponent extends Component { // Get parent SVG to render inside of const svg = this.parent; const { width, height } = DOMUtils.getSVGElementSize(svg, { - useAttrs: true, + useAttrs: true }); let root = hierarchy({ - children: this.children, + children: this.children }).sum((d: any) => d.size); // Grab the correct treemap tile function based on direction @@ -189,7 +189,7 @@ export class LayoutComponent extends Component { // Pass children data to the hierarchy layout // And calculate sum of sizes root = hierarchy({ - children: this.children, + children: this.children }).sum((d: any) => d.size); // Compute the position of all elements within the layout diff --git a/packages/core/src/configuration.ts b/packages/core/src/configuration.ts index ef490d5c1c..e1932cfc9a 100644 --- a/packages/core/src/configuration.ts +++ b/packages/core/src/configuration.ts @@ -21,7 +21,7 @@ import { BarTooltipOptions, LegendOptions, LegendPositions, - TruncationTypes, + TruncationTypes, StackedBarOptions, GaugeTypes } from "./interfaces"; @@ -33,14 +33,13 @@ import enUSLocaleObject from "date-fns/locale/en-US/index"; ***************************** */ - /** * Default truncation configuration */ const standardTruncationOptions = { type: TruncationTypes.END_LINE, threshold: 16, - numCharacter: 14, + numCharacter: 14 }; /** @@ -61,9 +60,9 @@ export const legend: LegendOptions = { }, checkbox: { radius: 6.5, - spaceAfter: 4, + spaceAfter: 4 }, - truncation: standardTruncationOptions, + truncation: standardTruncationOptions }; /** @@ -122,19 +121,19 @@ export const barChartTooltip: BarTooltipOptions = Tools.merge( const axes: AxesOptions = { top: { includeZero: true, - truncation: standardTruncationOptions, + truncation: standardTruncationOptions }, bottom: { includeZero: true, - truncation: standardTruncationOptions, + truncation: standardTruncationOptions }, left: { includeZero: true, - truncation: standardTruncationOptions, + truncation: standardTruncationOptions }, right: { includeZero: true, - truncation: standardTruncationOptions, + truncation: standardTruncationOptions } }; @@ -328,7 +327,10 @@ const gaugeChart: GaugeChartOptions = Tools.merge({}, chart, { numberSpacing: 10, deltaFontSize: (radius) => radius / 8, valueFontSize: (radius) => radius / 2.5, - numberFormatter: (number) => (number.toFixed(2) % 1 !== 0) ? number.toFixed(2).toLocaleString() : number.toFixed().toLocaleString() + numberFormatter: (number) => + number.toFixed(2) % 1 !== 0 + ? number.toFixed(2).toLocaleString() + : number.toFixed().toLocaleString() } } as GaugeChartOptions); diff --git a/packages/core/src/interfaces/a11y.ts b/packages/core/src/interfaces/a11y.ts index 35c981bdc4..0061d9bf02 100644 --- a/packages/core/src/interfaces/a11y.ts +++ b/packages/core/src/interfaces/a11y.ts @@ -2,5 +2,5 @@ export enum Roles { GRAPHICS_DOCUMENT = "graphics-document", GRAPHICS_OBJECT = "graphics-object", GRAPHICS_SYMBOL = "graphics-symbol", - GROUP = "group", + GROUP = "group" } diff --git a/packages/core/src/interfaces/charts.ts b/packages/core/src/interfaces/charts.ts index b884985b64..ec59975bae 100644 --- a/packages/core/src/interfaces/charts.ts +++ b/packages/core/src/interfaces/charts.ts @@ -1,8 +1,4 @@ -import { - GaugeTypes, - Statuses, - ArrowDirections -} from "./enums"; +import { GaugeTypes, Statuses, ArrowDirections } from "./enums"; import { LegendOptions, TooltipOptions, @@ -183,10 +179,10 @@ export interface LineChartOptions extends ScatterChartOptions { * options for the curve of the line */ curve?: - | string - | { - name: string; - }; + | string + | { + name: string; + }; } /** @@ -254,7 +250,7 @@ export interface GaugeChartOptions extends PieChartOptions { direction?: ArrowDirections; size?: Function; enabled: Boolean; - } + }; status?: Statuses; deltaFontSize?: Function; numberSpacing?: number; diff --git a/packages/core/src/interfaces/enums.ts b/packages/core/src/interfaces/enums.ts index ebb3c42751..20d21525d7 100644 --- a/packages/core/src/interfaces/enums.ts +++ b/packages/core/src/interfaces/enums.ts @@ -28,7 +28,7 @@ export enum TruncationTypes { END_LINE = "end_line", MID_LINE = "mid_line", FRONT_LINE = "front_line", - NONE = "none", + NONE = "none" } /** @@ -69,7 +69,7 @@ export enum TooltipTypes { GRIDLINE = "gridline", TITLE = "title", LEGEND = "legend", - AXISLABEL = "axislabel", + AXISLABEL = "axislabel" } /** diff --git a/packages/core/src/interfaces/events.ts b/packages/core/src/interfaces/events.ts index 7cd59a478e..b9974c802c 100644 --- a/packages/core/src/interfaces/events.ts +++ b/packages/core/src/interfaces/events.ts @@ -7,14 +7,14 @@ export enum Chart { MOUSEOVER = "chart-mouseover", // MOUSEMOVE = "chart-mousemove", // CLICK = "chart-click", - MOUSEOUT = "chart-mouseout", + MOUSEOUT = "chart-mouseout" } /** * enum of all events related to the chart model */ export enum Model { - UPDATE = "model-update", + UPDATE = "model-update" } /** @@ -24,7 +24,7 @@ export enum Axis { LABEL_MOUSEOVER = "axis-label-mouseover", LABEL_MOUSEMOVE = "axis-label-mousemove", LABEL_CLICK = "axis-label-click", - LABEL_MOUSEOUT = "axis-label-mouseout", + LABEL_MOUSEOUT = "axis-label-mouseout" } /** @@ -34,7 +34,7 @@ export enum Area { AREA_MOUSEOVER = "area-mouseover", AREA_MOUSEMOVE = "area-mousemove", AREA_CLICK = "area-click", - AREA_MOUSEOUT = "area-mouseout", + AREA_MOUSEOUT = "area-mouseout" } /** @@ -44,7 +44,7 @@ export enum Pie { SLICE_MOUSEOVER = "pie-slice-mouseover", SLICE_MOUSEMOVE = "pie-slice-mousemove", SLICE_CLICK = "pie-slice-click", - SLICE_MOUSEOUT = "pie-slice-mouseout", + SLICE_MOUSEOUT = "pie-slice-mouseout" } /** @@ -54,7 +54,7 @@ export enum Gauge { ARC_MOUSEOVER = "gauge-arc-mouseover", ARC_MOUSEMOVE = "gauge-arc-mousemove", ARC_CLICK = "gauge-arc-click", - ARC_MOUSEOUT = "gauge-arc-mouseout", + ARC_MOUSEOUT = "gauge-arc-mouseout" } /** @@ -64,7 +64,7 @@ export enum Bar { BAR_MOUSEOVER = "bar-mouseover", BAR_MOUSEMOVE = "bar-mousemove", BAR_CLICK = "bar-click", - BAR_MOUSEOUT = "bar-mouseout", + BAR_MOUSEOUT = "bar-mouseout" } /** @@ -74,7 +74,7 @@ export enum Scatter { SCATTER_MOUSEOVER = "scatter-mouseover", SCATTER_MOUSEMOVE = "scatter-mousemove", SCATTER_CLICK = "scatter-click", - SCATTER_MOUSEOUT = "scatter-mouseout", + SCATTER_MOUSEOUT = "scatter-mouseout" } /** @@ -84,7 +84,7 @@ export enum Line { POINT_MOUSEOVER = "scatter-mouseover", POINT_MOUSEMOVE = "scatter-mousemove", POINT_CLICK = "scatter-click", - POINT_MOUSEOUT = "scatter-mouseout", + POINT_MOUSEOUT = "scatter-mouseout" } /** @@ -94,7 +94,7 @@ export enum Radar { X_AXIS_MOUSEOVER = "radar-x-axis-mouseover", X_AXIS_MOUSEMOVE = "radar-x-axis-mousemove", X_AXIS_CLICK = "radar-x-axis-click", - X_AXIS_MOUSEOUT = "radar-x-axis-mouseout", + X_AXIS_MOUSEOUT = "radar-x-axis-mouseout" } /** @@ -102,7 +102,7 @@ export enum Radar { */ export enum Tooltip { SHOW = "show-tooltip", - HIDE = "hide-tooltip", + HIDE = "hide-tooltip" } /** @@ -110,7 +110,7 @@ export enum Tooltip { */ export enum Threshold { SHOW = "show-threshold", - HIDE = "hide-threshold", + HIDE = "hide-threshold" } /** @@ -120,5 +120,5 @@ export enum Legend { ITEM_HOVER = "legend-item-onhover", ITEM_CLICK = "legend-item-onclick", ITEM_MOUSEOUT = "legend-item-onmouseout", - ITEMS_UPDATE = "legend-items-update", + ITEMS_UPDATE = "legend-items-update" } diff --git a/packages/core/src/model.ts b/packages/core/src/model.ts index ff324b06d7..78a584bbd7 100644 --- a/packages/core/src/model.ts +++ b/packages/core/src/model.ts @@ -68,7 +68,8 @@ export class ChartModel { // Filter out data outside domain displayData = displayData.filter( - (datum) => datum[mapsTo] >= start && datum[mapsTo] <= end + (datum) => + datum[mapsTo] >= start && datum[mapsTo] <= end ); } } @@ -164,7 +165,7 @@ export class ChartModel { (datum) => datum[domainIdentifier] ).keys(); - const axisPosition = this.services.cartesianScales.domainAxisPosition; + const axisPosition = this.services.cartesianScales.domainAxisPosition; const scaleType = options.axes[axisPosition].scaleType; // Sort keys @@ -179,7 +180,7 @@ export class ChartModel { scaleType === ScaleTypes.LINEAR ) { stackKeys.sort((a: any, b: any) => a - b); - }; + } const dataGroupNames = this.getDataGroupNames(); diff --git a/packages/core/src/polyfills.ts b/packages/core/src/polyfills.ts index fed905a086..e344dfcb18 100644 --- a/packages/core/src/polyfills.ts +++ b/packages/core/src/polyfills.ts @@ -8,7 +8,7 @@ if (typeof window !== "undefined") { params = params || { bubbles: false, cancelable: false, - detail: undefined, + detail: undefined }; const evt = document.createEvent("CustomEvent"); evt.initCustomEvent( diff --git a/packages/core/src/services/angle-utils.ts b/packages/core/src/services/angle-utils.ts index a7ad920d52..eb9dda0bbe 100644 --- a/packages/core/src/services/angle-utils.ts +++ b/packages/core/src/services/angle-utils.ts @@ -18,43 +18,43 @@ export function radialLabelPlacement(angleRadians: Angle): LabelAlignment { if (isInRange(angle, [0, 10]) || isInRange(angle, [350, 0])) { return { textAnchor: TextAnchor.START, - dominantBaseline: DominantBaseline.MIDDLE, + dominantBaseline: DominantBaseline.MIDDLE }; } else if (isInRange(angle, [10, 80])) { return { textAnchor: TextAnchor.START, - dominantBaseline: DominantBaseline.HANGING, + dominantBaseline: DominantBaseline.HANGING }; } else if (isInRange(angle, [80, 100])) { return { textAnchor: TextAnchor.MIDDLE, - dominantBaseline: DominantBaseline.HANGING, + dominantBaseline: DominantBaseline.HANGING }; } else if (isInRange(angle, [100, 170])) { return { textAnchor: TextAnchor.END, - dominantBaseline: DominantBaseline.HANGING, + dominantBaseline: DominantBaseline.HANGING }; } else if (isInRange(angle, [170, 190])) { return { textAnchor: TextAnchor.END, - dominantBaseline: DominantBaseline.MIDDLE, + dominantBaseline: DominantBaseline.MIDDLE }; } else if (isInRange(angle, [190, 260])) { return { textAnchor: TextAnchor.END, - dominantBaseline: DominantBaseline.BASELINE, + dominantBaseline: DominantBaseline.BASELINE }; } else if (isInRange(angle, [260, 280])) { return { textAnchor: TextAnchor.MIDDLE, - dominantBaseline: DominantBaseline.BASELINE, + dominantBaseline: DominantBaseline.BASELINE }; } else { // 280 - 350 return { textAnchor: TextAnchor.START, - dominantBaseline: DominantBaseline.BASELINE, + dominantBaseline: DominantBaseline.BASELINE }; } } diff --git a/packages/core/src/services/colorPalettes.ts b/packages/core/src/services/colorPalettes.ts index d88321cdb7..b0c5d5add7 100644 --- a/packages/core/src/services/colorPalettes.ts +++ b/packages/core/src/services/colorPalettes.ts @@ -17,7 +17,7 @@ export const WHITE = [ colors.teal(50), colors.cyan(90), "#8a3800", // Orange 70 - colors.purple(50), + colors.purple(50) ]; export const DARK = [ @@ -34,7 +34,7 @@ export const DARK = [ colors.teal(40), colors.cyan(20), "#ba4e00", // Orange 60 - colors.purple(30), + colors.purple(30) ]; export const G10 = WHITE; diff --git a/packages/core/src/services/colors.ts b/packages/core/src/services/colors.ts index 4915aa1e73..72a34d317e 100644 --- a/packages/core/src/services/colors.ts +++ b/packages/core/src/services/colors.ts @@ -9,5 +9,5 @@ export default { magenta: (shade) => getColor(magenta, shade), purple: (shade) => getColor(purple, shade), red: (shade) => getColor(red, shade), - teal: (shade) => getColor(teal, shade), + teal: (shade) => getColor(teal, shade) }; diff --git a/packages/core/src/services/curves.ts b/packages/core/src/services/curves.ts index 978be337c5..09ac0d207d 100644 --- a/packages/core/src/services/curves.ts +++ b/packages/core/src/services/curves.ts @@ -21,7 +21,7 @@ import { CurveBundleFactory, CurveCardinalFactory, CurveCatmullRomFactory, - CurveGenerator, + CurveGenerator } from "d3-shape"; // this import is needed because of typescript bug (error TS4029) @@ -49,7 +49,7 @@ export class Curves extends Service { curveNatural, curveStep, curveStepAfter, - curveStepBefore, + curveStepBefore }; getD3Curve() { diff --git a/packages/core/src/services/essentials/dom-utils.ts b/packages/core/src/services/essentials/dom-utils.ts index aa8de70cc2..dffaa2138b 100644 --- a/packages/core/src/services/essentials/dom-utils.ts +++ b/packages/core/src/services/essentials/dom-utils.ts @@ -23,7 +23,7 @@ export class DOMUtils extends Service { const finalDimensions = { width: 0, - height: 0, + height: 0 }; const validateAndSetDimensions = (dimensions) => { @@ -46,7 +46,7 @@ export class DOMUtils extends Service { const attrDimensions = { width: svgSelector.attr("width"), - height: svgSelector.attr("height"), + height: svgSelector.attr("height") }; let bbox, bboxDimensions, boundingRect, boundingRectDimensions; @@ -56,7 +56,7 @@ export class DOMUtils extends Service { bbox = svgSelector.node().getBBox(); bboxDimensions = { width: bbox.width, - height: bbox.height, + height: bbox.height }; } catch (e) {} @@ -64,13 +64,13 @@ export class DOMUtils extends Service { boundingRect = svgSelector.node().getBoundingClientRect(); boundingRectDimensions = { width: boundingRect.width, - height: boundingRect.height, + height: boundingRect.height }; } catch (e) {} const clientDimensions = { width: svgSelector.node().clientWidth, - height: svgSelector.node().clientHeight, + height: svgSelector.node().clientHeight }; // If both attribute values are numbers @@ -122,7 +122,7 @@ export class DOMUtils extends Service { "height", "baseVal", "value" - ), + ) }; validateAndSetDimensions(nativeDimensions); diff --git a/packages/core/src/services/essentials/events.ts b/packages/core/src/services/essentials/events.ts index ed4d9c22e7..dfcbfff407 100644 --- a/packages/core/src/services/essentials/events.ts +++ b/packages/core/src/services/essentials/events.ts @@ -28,7 +28,7 @@ export class Events extends Service { let newEvent; if (eventDetail) { newEvent = new CustomEvent(eventType, { - detail: eventDetail, + detail: eventDetail }); } else { newEvent = document.createEvent("Event"); diff --git a/packages/core/src/services/scales-cartesian.ts b/packages/core/src/services/scales-cartesian.ts index 5c2d785360..603bfc54b3 100644 --- a/packages/core/src/services/scales-cartesian.ts +++ b/packages/core/src/services/scales-cartesian.ts @@ -6,7 +6,7 @@ import { CartesianOrientations, ScaleTypes, AxesOptions, - ThresholdOptions, + ThresholdOptions } from "../interfaces"; import { Tools } from "../tools"; @@ -34,7 +34,7 @@ import { subMinutes, differenceInSeconds, subSeconds, - addSeconds, + addSeconds } from "date-fns"; export class CartesianScales extends Service { @@ -42,14 +42,14 @@ export class CartesianScales extends Service { top: null, right: null, bottom: null, - left: null, + left: null }; protected scales = { top: null, right: null, bottom: null, - left: null, + left: null }; protected domainAxisPosition: AxisPositions; @@ -129,7 +129,7 @@ export class CartesianScales extends Service { getMainXAxisPosition() { const possibleXAxisPositions = [ AxisPositions.BOTTOM, - AxisPositions.TOP, + AxisPositions.TOP ]; return [this.domainAxisPosition, this.rangeAxisPosition].find( @@ -141,7 +141,7 @@ export class CartesianScales extends Service { getMainYAxisPosition() { const possibleYAxisPositions = [ AxisPositions.LEFT, - AxisPositions.RIGHT, + AxisPositions.RIGHT ]; return [this.domainAxisPosition, this.rangeAxisPosition].find( @@ -303,7 +303,7 @@ export class CartesianScales extends Service { const result = { domainAxisPosition: null, - rangeAxisPosition: null, + rangeAxisPosition: null }; if ( mainHorizontalScaleType === ScaleTypes.LABELS || @@ -439,7 +439,7 @@ export class CartesianScales extends Service { return { threshold: highestThreshold, - scaleValue: domainScale(highestThreshold.value), + scaleValue: domainScale(highestThreshold.value) }; } @@ -464,7 +464,7 @@ export class CartesianScales extends Service { return { threshold: highestThreshold, - scaleValue: rangeScale(highestThreshold.value), + scaleValue: rangeScale(highestThreshold.value) }; } } @@ -476,56 +476,56 @@ function addSpacingToTimeDomain(domain: any, spaceToAddToEdges: number) { if (differenceInYears(endDate, startDate) > 1) { return [ subYears(startDate, spaceToAddToEdges), - addYears(endDate, spaceToAddToEdges), + addYears(endDate, spaceToAddToEdges) ]; } if (differenceInMonths(endDate, startDate) > 1) { return [ subMonths(startDate, spaceToAddToEdges), - addMonths(endDate, spaceToAddToEdges), + addMonths(endDate, spaceToAddToEdges) ]; } if (differenceInDays(endDate, startDate) > 1) { return [ subDays(startDate, spaceToAddToEdges), - addDays(endDate, spaceToAddToEdges), + addDays(endDate, spaceToAddToEdges) ]; } if (differenceInHours(endDate, startDate) > 1) { return [ subHours(startDate, spaceToAddToEdges), - addHours(endDate, spaceToAddToEdges), + addHours(endDate, spaceToAddToEdges) ]; } if (differenceInMinutes(endDate, startDate) > 30) { return [ subMinutes(startDate, spaceToAddToEdges * 30), - addMinutes(endDate, spaceToAddToEdges * 30), + addMinutes(endDate, spaceToAddToEdges * 30) ]; } if (differenceInMinutes(endDate, startDate) > 1) { return [ subMinutes(startDate, spaceToAddToEdges), - addMinutes(endDate, spaceToAddToEdges), + addMinutes(endDate, spaceToAddToEdges) ]; } if (differenceInSeconds(endDate, startDate) > 15) { return [ subSeconds(startDate, spaceToAddToEdges * 15), - addSeconds(endDate, spaceToAddToEdges * 15), + addSeconds(endDate, spaceToAddToEdges * 15) ]; } if (differenceInSeconds(endDate, startDate) > 1) { return [ subSeconds(startDate, spaceToAddToEdges), - addSeconds(endDate, spaceToAddToEdges), + addSeconds(endDate, spaceToAddToEdges) ]; } diff --git a/packages/core/src/services/time-series.spec.ts b/packages/core/src/services/time-series.spec.ts index b2a89a18e9..a9d91e769e 100644 --- a/packages/core/src/services/time-series.spec.ts +++ b/packages/core/src/services/time-series.spec.ts @@ -32,7 +32,7 @@ it("should format ticks with timeInterval 15seconds", () => { [new Date(2020, 11, 11, 0, 0, 0), "Dec 11, 12:00:00 AM"], [new Date(2020, 11, 11, 0, 0, 15), "12:00:15 AM"], [new Date(2020, 11, 11, 0, 0, 30), "12:00:30 AM"], - [new Date(2020, 11, 11, 0, 0, 45), "12:00:45 AM"], + [new Date(2020, 11, 11, 0, 0, 45), "12:00:45 AM"] ]; const { timestamps, formattedTicks } = getTimestampsAndFormattedTicks( dataset @@ -57,7 +57,7 @@ it("should format ticks with timeInterval minute", () => { [new Date(2020, 4, 22, 11, 59, 0), "11:59 AM"], [new Date(2020, 4, 22, 12, 0, 0), "12:00 PM"], [new Date(2020, 4, 22, 12, 1, 0, 0), "12:01 PM"], - [new Date(2020, 4, 22, 12, 2, 0), "12:02 PM"], + [new Date(2020, 4, 22, 12, 2, 0), "12:02 PM"] ]; const { timestamps, formattedTicks } = getTimestampsAndFormattedTicks( dataset @@ -77,7 +77,7 @@ it("should format ticks with timeInterval 30minutes", () => { [new Date(2020, 11, 11, 0, 0), "Dec 11, 12:00 AM"], [new Date(2020, 11, 11, 0, 30), "12:30 AM"], [new Date(2020, 11, 11, 1, 0), "1:00 AM"], - [new Date(2020, 11, 11, 1, 30), "1:30 AM"], + [new Date(2020, 11, 11, 1, 30), "1:30 AM"] ]; const { timestamps, formattedTicks } = getTimestampsAndFormattedTicks( dataset @@ -103,11 +103,11 @@ it("should format ticks with timeInterval hourly", () => { [new Date(2020, 11, 11, 12, 0), "12 PM"], [new Date(2020, 11, 11, 13, 0), "01 PM"], [new Date(2020, 11, 11, 14, 0), "02 PM"], - [new Date(2020, 11, 11, 15, 0), "03 PM"], + [new Date(2020, 11, 11, 15, 0), "03 PM"] ]; const { timestamps: timestampsDefaultFormats, - formattedTicks: formattedTicksDefaultFormats, + formattedTicks: formattedTicksDefaultFormats } = getTimestampsAndFormattedTicks(datasetDefaultFormats); const timeIntervalDefaultFormats = computeTimeIntervalName( timestampsDefaultFormats @@ -134,11 +134,11 @@ it("should format ticks with timeInterval hourly", () => { [new Date(2020, 11, 11, 12, 0), "12:00"], [new Date(2020, 11, 11, 13, 0), "13:00"], [new Date(2020, 11, 11, 14, 0), "14:00"], - [new Date(2020, 11, 11, 15, 0), "15:00"], + [new Date(2020, 11, 11, 15, 0), "15:00"] ]; const { timestamps: timestampsCustomFormats, - formattedTicks: formattedTicksCustomFormats, + formattedTicks: formattedTicksCustomFormats } = getTimestampsAndFormattedTicks(datasetCustomFormats); const timeIntervalCustomFormats = computeTimeIntervalName( timestampsCustomFormats @@ -147,8 +147,8 @@ it("should format ticks with timeInterval hourly", () => { const timeScaleCustomOptions = { ...timeScaleDefaultOptions, timeIntervalFormats: { - hourly: { primary: "MMM d, HH:mm", secondary: "HH:mm" }, - }, + hourly: { primary: "MMM d, HH:mm", secondary: "HH:mm" } + } }; expect( format( @@ -172,7 +172,7 @@ it("should format ticks with timeInterval daily", () => { [new Date(2020, 0, 31), "31"], [new Date(2020, 1, 1), "Feb 1"], [new Date(2020, 1, 2), "2"], - [new Date(2020, 1, 3), "3"], + [new Date(2020, 1, 3), "3"] ]; const { timestamps, formattedTicks } = getTimestampsAndFormattedTicks( dataset @@ -197,7 +197,7 @@ it("should format ticks with timeInterval weekly", () => { [new Date(2020, 1, 4), "Tue"], [new Date(2020, 1, 5), "Wed"], [new Date(2020, 1, 6), "Thu"], - [new Date(2020, 1, 7), "Fri"], + [new Date(2020, 1, 7), "Fri"] ]; const { timestamps, formattedTicks } = getTimestampsAndFormattedTicks( dataset @@ -206,7 +206,7 @@ it("should format ticks with timeInterval weekly", () => { expect(timeInterval).toEqual("daily"); const timeScaleCustomOptions = { ...timeScaleDefaultOptions, - showDayName: true, + showDayName: true }; expect(format(timestamps, timeInterval, timeScaleCustomOptions)).toEqual( formattedTicks @@ -227,11 +227,11 @@ it("should format ticks with timeInterval monthly", () => { [new Date(2019, 11), "Dec"], [new Date(2020, 0), "Jan 2020"], [new Date(2020, 1), "Feb"], - [new Date(2020, 2), "Mar"], + [new Date(2020, 2), "Mar"] ]; const { timestamps: timestampsdefaultFormats, - formattedTicks: formattedTicksdefaultFormats, + formattedTicks: formattedTicksdefaultFormats } = getTimestampsAndFormattedTicks(datasetdefaultFormats); const timeIntervaldefaultFormats = computeTimeIntervalName( timestampsdefaultFormats @@ -258,11 +258,11 @@ it("should format ticks with timeInterval monthly", () => { [new Date(2019, 11), "déc."], [new Date(2020, 0), "janv. 2020"], [new Date(2020, 1), "févr."], - [new Date(2020, 2), "mars"], + [new Date(2020, 2), "mars"] ]; const { timestamps: timestampsCustomFormats, - formattedTicks: formattedTicksCustomFormats, + formattedTicks: formattedTicksCustomFormats } = getTimestampsAndFormattedTicks(datasetCustomFormats); const timeIntervalCustomFormats = computeTimeIntervalName( timestampsCustomFormats @@ -270,7 +270,7 @@ it("should format ticks with timeInterval monthly", () => { expect(timeIntervalCustomFormats).toEqual("monthly"); const timeScaleCustomOptions = { ...timeScaleDefaultOptions, - localeObject: frLocaleObject, + localeObject: frLocaleObject }; expect( format( @@ -294,7 +294,7 @@ it("should format ticks with timeInterval quarterly", () => { [new Date(2019, 5), `Q2`], [new Date(2019, 7), `Q3`], [new Date(2019, 10), `Q4`], - [new Date(2020, 0), `Q1 '20`], + [new Date(2020, 0), `Q1 '20`] ]; const { timestamps, formattedTicks } = getTimestampsAndFormattedTicks( dataset @@ -319,7 +319,7 @@ it("should format ticks with timeInterval yearly", () => { [new Date(2016, 0), "2016"], [new Date(2017, 0), "2017"], [new Date(2018, 0), "2018"], - [new Date(2019, 0), "2019"], + [new Date(2019, 0), "2019"] ]; const { timestamps, formattedTicks } = getTimestampsAndFormattedTicks( dataset diff --git a/packages/core/src/services/time-series.ts b/packages/core/src/services/time-series.ts index aa45187004..8a619b33fa 100644 --- a/packages/core/src/services/time-series.ts +++ b/packages/core/src/services/time-series.ts @@ -13,7 +13,7 @@ export const TIME_INTERVALS = [ ["daily", 24 * 60 * 60 * 1000], ["monthly", 30 * 24 * 60 * 60 * 1000], ["quarterly", 3 * 30 * 24 * 60 * 60 * 1000], - ["yearly", 12 * 30 * 24 * 60 * 60 * 1000], + ["yearly", 12 * 30 * 24 * 60 * 60 * 1000] ]; // Return true if the tick is a primary tick, false otherwise @@ -110,7 +110,7 @@ export function getTimeformats(timestamp: number) { d: date.getDate(), // day of the month: 1-31 H: date.getHours(), // 24-hour clock: 0-23 m: date.getMinutes(), // minute: 0-59 - s: date.getSeconds(), // seconds: 0-59 + s: date.getSeconds() // seconds: 0-59 }; } diff --git a/packages/core/src/tests/test-environment.ts b/packages/core/src/tests/test-environment.ts index 84c74ab998..7ca1d518cf 100644 --- a/packages/core/src/tests/test-environment.ts +++ b/packages/core/src/tests/test-environment.ts @@ -9,7 +9,7 @@ import { groupedBarData, groupedBarOptions } from "../../demo/data"; export const data = groupedBarData as ChartData; export const options = Object.assign(groupedBarOptions, { - title: "My chart", + title: "My chart" }) as any; export class TestEnvironment { @@ -22,7 +22,7 @@ export class TestEnvironment { this.chart = new Charts.ScatterChart(holder, { data: this.chartData, - options: this.chartOptions, + options: this.chartOptions }); } diff --git a/packages/core/src/tools.spec.ts b/packages/core/src/tools.spec.ts index 9f74123d92..b09c82f19f 100644 --- a/packages/core/src/tools.spec.ts +++ b/packages/core/src/tools.spec.ts @@ -44,32 +44,32 @@ describe("Tools.mergeDefaultChartOptions", () => { title: "Title", axes: { bottom: { - title: "Title", + title: "Title" }, left: { - scaleType: "time", - }, - }, + scaleType: "time" + } + } }; const defaultOptions = { axes: { top: { - includeZero: true, + includeZero: true }, bottom: { - includeZero: true, + includeZero: true }, left: { - includeZero: true, + includeZero: true }, right: { - includeZero: true, - }, + includeZero: true + } }, timeScale: { - addSpaceOnEdges: 1, - }, + addSpaceOnEdges: 1 + } }; const expectedMerge = { @@ -78,17 +78,17 @@ describe("Tools.mergeDefaultChartOptions", () => { bottom: { includeZero: true, title: "Title", - mapsTo: "value", + mapsTo: "value" }, left: { includeZero: true, scaleType: "time", - mapsTo: "date", - }, + mapsTo: "date" + } }, timeScale: { - addSpaceOnEdges: 1, - }, + addSpaceOnEdges: 1 + } }; expect( diff --git a/packages/core/src/tools.ts b/packages/core/src/tools.ts index 49d22937c1..01c790b1ff 100644 --- a/packages/core/src/tools.ts +++ b/packages/core/src/tools.ts @@ -19,7 +19,7 @@ import { some as lodashSome, // the imports below are needed because of typescript bug (error TS4029) Cancelable, - DebounceSettings, + DebounceSettings } from "lodash-es"; import { Numeric } from "d3"; @@ -111,7 +111,7 @@ export namespace Tools { ), height: parseFloat( el.style.height.replace("px", "") || el.offsetHeight - ), + ) }; } @@ -145,7 +145,7 @@ export namespace Tools { return { tx: transforms[0], - ty: transforms[1], + ty: transforms[1] }; } return null; @@ -169,7 +169,7 @@ export namespace Tools { return { x: parseFloat(xyString[0]), - y: parseFloat(xyString[1]), + y: parseFloat(xyString[1]) }; } @@ -218,7 +218,7 @@ export namespace Tools { : percentage; } - /** + /** * Truncate the labels * @export * @param {any} fullText @@ -231,7 +231,11 @@ export namespace Tools { return fullText; } if (truncationType === TruncationTypes.MID_LINE) { - return fullText.substr(0, numCharacter / 2) + "..." + fullText.substr(-numCharacter / 2); + return ( + fullText.substr(0, numCharacter / 2) + + "..." + + fullText.substr(-numCharacter / 2) + ); } else if (truncationType === TruncationTypes.FRONT_LINE) { return "..." + fullText.substr(-numCharacter); } else if (truncationType === TruncationTypes.END_LINE) { @@ -255,7 +259,7 @@ export namespace Tools { export function arrayDifferences(oldArray: any[], newArray: any[]) { const difference = { missing: [], - added: [], + added: [] }; oldArray.forEach((element) => { @@ -358,7 +362,7 @@ export namespace Tools { y0: verticalCoordinates.x0, y1: verticalCoordinates.x1, x0: verticalCoordinates.y0, - x1: verticalCoordinates.y1, + x1: verticalCoordinates.y1 }; } diff --git a/packages/core/stories/all.stories.ts b/packages/core/stories/all.stories.ts index 7e884c599c..a638409ff2 100644 --- a/packages/core/stories/all.stories.ts +++ b/packages/core/stories/all.stories.ts @@ -121,7 +121,7 @@ ${storyUtils.generateThemePickerHTML()} container.querySelector("div#chart-demo"), { data: object("Data", demo.data), - options: object("Options", demo.options), + options: object("Options", demo.options) } ); @@ -179,7 +179,7 @@ if (process.env.NODE_ENV !== "production") { column.setAttribute("id", demo.title); const chart = new ClassToInitialize(column, { data: demo.data, - options: demo.options, + options: demo.options }); row.appendChild(column); diff --git a/packages/core/stories/tutorials.stories.ts b/packages/core/stories/tutorials.stories.ts index 8a106a7a82..6c9892b74b 100644 --- a/packages/core/stories/tutorials.stories.ts +++ b/packages/core/stories/tutorials.stories.ts @@ -9,7 +9,7 @@ import { reactTutorial, angularTutorial, vanillaTutorial, - vueTutorial, + vueTutorial } from "./tutorials/index"; // Syntax highlighting diff --git a/packages/vue/CHANGELOG.md b/packages/vue/CHANGELOG.md index f426ae8d0a..c36065bbdb 100644 --- a/packages/vue/CHANGELOG.md +++ b/packages/vue/CHANGELOG.md @@ -7,76 +7,39 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline **Note:** Version bump only for package @carbon/charts-vue - - - - ## [0.32.11](https://github.com/carbon-design-system/carbon-charts/compare/v0.32.10...v0.32.11) (2020-06-24) **Note:** Version bump only for package @carbon/charts-vue - - - - ## [0.32.10](https://github.com/carbon-design-system/carbon-charts/compare/v0.32.9...v0.32.10) (2020-06-24) **Note:** Version bump only for package @carbon/charts-vue - - - - ## [0.32.9](https://github.com/carbon-design-system/carbon-charts/compare/v0.32.8...v0.32.9) (2020-06-23) **Note:** Version bump only for package @carbon/charts-vue - - - - ## [0.32.8](https://github.com/carbon-design-system/carbon-charts/compare/v0.32.7...v0.32.8) (2020-06-19) **Note:** Version bump only for package @carbon/charts-vue - - - - ## [0.32.7](https://github.com/carbon-design-system/carbon-charts/compare/v0.32.6...v0.32.7) (2020-06-16) **Note:** Version bump only for package @carbon/charts-vue - - - - ## [0.32.6](https://github.com/carbon-design-system/carbon-charts/compare/v0.32.5...v0.32.6) (2020-06-12) **Note:** Version bump only for package @carbon/charts-vue - - - - ## [0.32.5](https://github.com/carbon-design-system/carbon-charts/compare/v0.32.4...v0.32.5) (2020-06-11) **Note:** Version bump only for package @carbon/charts-vue - - - - ## [0.32.4](https://github.com/carbon-design-system/carbon-charts/compare/v0.32.3...v0.32.4) (2020-06-10) - ### Bug Fixes -* update tslint and prettier options ([#661](https://github.com/carbon-design-system/carbon-charts/issues/661)) ([ebc53d9](https://github.com/carbon-design-system/carbon-charts/commit/ebc53d9f4caea047f656ae98075b9c8ca307b280)) - - - - +- update tslint and prettier options ([#661](https://github.com/carbon-design-system/carbon-charts/issues/661)) ([ebc53d9](https://github.com/carbon-design-system/carbon-charts/commit/ebc53d9f4caea047f656ae98075b9c8ca307b280)) ## [0.32.3](https://github.com/carbon-design-system/carbon-charts/compare/v0.32.2...v0.32.3) (2020-06-08) From e6992008f67cac69a9381ea5e9aa0122f98e6c3d Mon Sep 17 00:00:00 2001 From: Eliad Moosavi Date: Tue, 7 Jul 2020 11:37:04 -0400 Subject: [PATCH 3/4] PR changes --- packages/core/src/components/axes/axis.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/core/src/components/axes/axis.ts b/packages/core/src/components/axes/axis.ts index eae06807ec..928ffe0e04 100644 --- a/packages/core/src/components/axes/axis.ts +++ b/packages/core/src/components/axes/axis.ts @@ -202,11 +202,9 @@ export class Axis extends Component { let tickValues; if (addSpaceOnEdges) { tickValues = scale - .nice(numberOfTicks) - .ticks(numberOfTicks); - } else { - tickValues = scale.ticks(numberOfTicks); + .nice(numberOfTicks); } + tickValues = scale.ticks(numberOfTicks); // Remove labels on the edges // If there are more than 2 labels to show From c26698dcbb04e62665b24f0dc620d636766d2306 Mon Sep 17 00:00:00 2001 From: Eliad Moosavi Date: Tue, 7 Jul 2020 11:43:45 -0400 Subject: [PATCH 4/4] format --- packages/core/src/components/axes/axis.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/core/src/components/axes/axis.ts b/packages/core/src/components/axes/axis.ts index 928ffe0e04..f43b33816a 100644 --- a/packages/core/src/components/axes/axis.ts +++ b/packages/core/src/components/axes/axis.ts @@ -201,8 +201,7 @@ export class Axis extends Component { let tickValues; if (addSpaceOnEdges) { - tickValues = scale - .nice(numberOfTicks); + tickValues = scale.nice(numberOfTicks); } tickValues = scale.ticks(numberOfTicks);