@carbon/charts 0.41.58 → 0.41.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -2
- package/axis-chart.js +2 -2
- package/axis-chart.js.map +1 -1
- package/build/demo/data/CHART_TYPES.d.ts +5 -0
- package/build/demo/data/bar.d.ts +55 -0
- package/build/demo/data/bullet.d.ts +30 -0
- package/build/demo/data/index.d.ts +1 -0
- package/build/src/charts/bullet.d.ts +6 -0
- package/build/src/charts/index.d.ts +1 -0
- package/build/src/components/graphs/bullet.d.ts +11 -0
- package/build/src/components/index.d.ts +1 -0
- package/build/src/configuration-non-customizable.d.ts +4 -1
- package/build/src/configuration.d.ts +2 -1
- package/build/src/interfaces/axis-scales.d.ts +7 -0
- package/build/src/interfaces/charts.d.ts +11 -0
- package/build/src/interfaces/enums.d.ts +2 -1
- package/bundle.js +1 -1
- package/chart.js +1 -1
- package/chart.js.map +1 -1
- package/charts/bullet.d.ts +6 -0
- package/charts/bullet.js +48 -0
- package/charts/bullet.js.map +1 -0
- package/charts/index.d.ts +1 -0
- package/charts/index.js +1 -0
- package/charts/index.js.map +1 -1
- package/components/axes/axis.js +5 -4
- package/components/axes/axis.js.map +1 -1
- package/components/axes/grid.js +2 -2
- package/components/axes/grid.js.map +1 -1
- package/components/essentials/legend.js +2 -13
- package/components/essentials/legend.js.map +1 -1
- package/components/essentials/tooltip-axis.js +27 -7
- package/components/essentials/tooltip-axis.js.map +1 -1
- package/components/graphs/area-stacked.js +9 -6
- package/components/graphs/area-stacked.js.map +1 -1
- package/components/graphs/area.js +3 -1
- package/components/graphs/area.js.map +1 -1
- package/components/graphs/bar-simple.js +11 -2
- package/components/graphs/bar-simple.js.map +1 -1
- package/components/graphs/bar-stacked.js +1 -1
- package/components/graphs/bar-stacked.js.map +1 -1
- package/components/graphs/bubble.js +7 -6
- package/components/graphs/bubble.js.map +1 -1
- package/components/graphs/bullet.d.ts +11 -0
- package/components/graphs/bullet.js +360 -0
- package/components/graphs/bullet.js.map +1 -0
- package/components/graphs/line.js +1 -1
- package/components/graphs/line.js.map +1 -1
- package/components/graphs/scatter-stacked.js +1 -1
- package/components/graphs/scatter-stacked.js.map +1 -1
- package/components/index.d.ts +1 -0
- package/components/index.js +1 -0
- package/components/index.js.map +1 -1
- package/configuration-non-customizable.d.ts +4 -1
- package/configuration-non-customizable.js +7 -3
- package/configuration-non-customizable.js.map +1 -1
- package/configuration.d.ts +2 -1
- package/configuration.js +17 -0
- package/configuration.js.map +1 -1
- package/demo/data/CHART_TYPES.d.ts +5 -0
- package/demo/data/CHART_TYPES.js +5 -0
- package/demo/data/CHART_TYPES.js.map +1 -1
- package/demo/data/bar.d.ts +55 -0
- package/demo/data/bar.js +61 -0
- package/demo/data/bar.js.map +1 -1
- package/demo/data/bullet.d.ts +30 -0
- package/demo/data/bullet.js +75 -0
- package/demo/data/bullet.js.map +1 -0
- package/demo/data/bundle.js +1 -1
- package/demo/data/index.d.ts +1 -0
- package/demo/data/index.js +33 -0
- package/demo/data/index.js.map +1 -1
- package/demo/styles.css +144 -0
- package/demo/styles.css.map +1 -1
- package/demo/styles.min.css +1 -1
- package/demo/styles.min.css.map +1 -1
- package/demo/tsconfig.tsbuildinfo +20 -6
- package/interfaces/axis-scales.d.ts +7 -0
- package/interfaces/axis-scales.js.map +1 -1
- package/interfaces/charts.d.ts +11 -0
- package/interfaces/charts.js.map +1 -1
- package/interfaces/enums.d.ts +2 -1
- package/interfaces/enums.js +1 -0
- package/interfaces/enums.js.map +1 -1
- package/package.json +1 -1
- package/services/scales-cartesian.js +23 -5
- package/services/scales-cartesian.js.map +1 -1
- package/styles/colors.scss +28 -0
- package/styles/components/_axis.scss +3 -1
- package/styles/graphs/_bullet.scss +67 -0
- package/styles/graphs/index.scss +1 -0
- package/styles-g10.css +38 -0
- package/styles-g10.css.map +1 -1
- package/styles-g10.min.css +1 -1
- package/styles-g10.min.css.map +1 -1
- package/styles-g100.css +38 -0
- package/styles-g100.css.map +1 -1
- package/styles-g100.min.css +1 -1
- package/styles-g100.min.css.map +1 -1
- package/styles-g90.css +38 -0
- package/styles-g90.css.map +1 -1
- package/styles-g90.min.css +1 -1
- package/styles-g90.min.css.map +1 -1
- package/styles.css +38 -0
- package/styles.css.map +1 -1
- package/styles.min.css +1 -1
- package/styles.min.css.map +1 -1
- package/tsconfig.tsbuildinfo +75 -28
package/CHANGELOG.md
CHANGED
|
@@ -3,21 +3,46 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [0.41.
|
|
6
|
+
## [0.41.62](https://github.com/carbon-design-system/carbon-charts/compare/v0.41.61...v0.41.62) (2021-04-29)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **core:** fix minor bug with data values that are undefined ([#1007](https://github.com/carbon-design-system/carbon-charts/issues/1007)) ([5c4db99](https://github.com/carbon-design-system/carbon-charts/commit/5c4db996e3aaf5b8c8146b686945c9eb4a191b46))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# Change Log
|
|
18
|
+
|
|
19
|
+
All notable changes to this project will be documented in this file. See
|
|
20
|
+
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
21
|
+
|
|
22
|
+
## [0.41.61](https://github.com/carbon-design-system/carbon-charts/compare/v0.41.60...v0.41.61) (2021-04-28)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @carbon/charts
|
|
9
25
|
|
|
26
|
+
# Change Log
|
|
10
27
|
|
|
28
|
+
All notable changes to this project will be documented in this file. See
|
|
29
|
+
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
11
30
|
|
|
31
|
+
## [0.41.60](https://github.com/carbon-design-system/carbon-charts/compare/v0.41.59...v0.41.60) (2021-04-28)
|
|
12
32
|
|
|
33
|
+
**Note:** Version bump only for package @carbon/charts
|
|
13
34
|
|
|
14
|
-
## [0.41.
|
|
35
|
+
## [0.41.59](https://github.com/carbon-design-system/carbon-charts/compare/v0.41.58...v0.41.59) (2021-04-27)
|
|
15
36
|
|
|
16
37
|
**Note:** Version bump only for package @carbon/charts
|
|
17
38
|
|
|
39
|
+
## [0.41.58](https://github.com/carbon-design-system/carbon-charts/compare/v0.41.57...v0.41.58) (2021-04-26)
|
|
18
40
|
|
|
41
|
+
**Note:** Version bump only for package @carbon/charts
|
|
19
42
|
|
|
43
|
+
## [0.41.57](https://github.com/carbon-design-system/carbon-charts/compare/v0.41.56...v0.41.57) (2021-04-20)
|
|
20
44
|
|
|
45
|
+
**Note:** Version bump only for package @carbon/charts
|
|
21
46
|
|
|
22
47
|
# Change Log
|
|
23
48
|
|
package/axis-chart.js
CHANGED
|
@@ -88,7 +88,7 @@ var AxisChart = /** @class */ (function (_super) {
|
|
|
88
88
|
components: [new Legend(this.model, this.services)],
|
|
89
89
|
growth: {
|
|
90
90
|
x: LayoutGrowth.PREFERRED,
|
|
91
|
-
y: LayoutGrowth.
|
|
91
|
+
y: LayoutGrowth.PREFERRED,
|
|
92
92
|
},
|
|
93
93
|
};
|
|
94
94
|
// if all zoom bars are locked, no need to add chart brush
|
|
@@ -101,7 +101,7 @@ var AxisChart = /** @class */ (function (_super) {
|
|
|
101
101
|
components: graphFrameComponents,
|
|
102
102
|
growth: {
|
|
103
103
|
x: LayoutGrowth.STRETCH,
|
|
104
|
-
y: LayoutGrowth.
|
|
104
|
+
y: LayoutGrowth.STRETCH,
|
|
105
105
|
},
|
|
106
106
|
};
|
|
107
107
|
var isLegendEnabled = Tools.getProperty(configs, 'legend', 'enabled') !== false &&
|
package/axis-chart.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"axis-chart.js","sourceRoot":"","sources":["axis-chart.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,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AAC;YAEF,wBAAwB,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;SACpD;QACD,IAAI,cAAc,EAAE;YACnB,wBAAwB,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;SAChD;QACD,wBAAwB,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;QAElD,OAAO;YACN,IAAI,iBAAiB,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC;YAChD,IAAI,eAAe,CAClB,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,QAAQ,EACb,wBAAwB,EACxB;gBACC,SAAS,EAAE,eAAe,CAAC,MAAM;aACjC,CACD;SACD,CAAC;IACH,CAAC;IACF,gBAAC;AAAD,CAAC,AAlOD,CAA+B,KAAK,GAkOnC","sourcesContent":["import { Chart } from './chart';\nimport { ChartModelCartesian } from './model-cartesian-charts';\nimport {\n\tLayoutDirection,\n\tLayoutGrowth,\n\tLegendOrientations,\n\tLegendPositions,\n\tChartConfig,\n\tAxisChartOptions,\n\tAxisPositions,\n\tScaleTypes,\n} from './interfaces';\nimport {\n\tChartBrush,\n\tChartClip,\n\tLayoutComponent,\n\tLegend,\n\tThreshold,\n\tTitle,\n\tAxisChartsTooltip,\n\tSpacer,\n\tToolbar,\n\tZoomBar,\n} from './components';\nimport { Tools } from './tools';\n\nimport { CartesianScales, Curves, Zoom } from './services';\n\nexport class AxisChart extends Chart {\n\tservices: any = Object.assign(this.services, {\n\t\tcartesianScales: CartesianScales,\n\t\tcurves: Curves,\n\t\tzoom: Zoom,\n\t});\n\tmodel: ChartModelCartesian = new ChartModelCartesian(this.services);\n\n\tconstructor(holder: Element, chartConfigs: ChartConfig<AxisChartOptions>) {\n\t\tsuper(holder, chartConfigs);\n\t}\n\n\tprotected getAxisChartComponents(\n\t\tgraphFrameComponents: any[],\n\t\tconfigs?: object\n\t) {\n\t\tconst options = this.model.getOptions();\n\t\tconst isZoomBarEnabled = Tools.getProperty(\n\t\t\toptions,\n\t\t\t'zoomBar',\n\t\t\tAxisPositions.TOP,\n\t\t\t'enabled'\n\t\t);\n\t\tconst toolbarEnabled = Tools.getProperty(options, 'toolbar', 'enabled');\n\n\t\tthis.services.cartesianScales.determineAxisDuality();\n\t\tthis.services.cartesianScales.findDomainAndRangeAxes(); // need to do this before getMainXAxisPosition()\n\t\tthis.services.cartesianScales.determineOrientation();\n\n\t\tconst mainXAxisPosition = this.services.cartesianScales.getMainXAxisPosition();\n\t\tconst mainXScaleType = Tools.getProperty(\n\t\t\toptions,\n\t\t\t'axes',\n\t\t\tmainXAxisPosition,\n\t\t\t'scaleType'\n\t\t);\n\t\t// @todo - Zoom Bar only supports main axis at BOTTOM axis and time scale for now\n\t\tconst zoomBarEnabled =\n\t\t\tisZoomBarEnabled &&\n\t\t\tmainXAxisPosition === AxisPositions.BOTTOM &&\n\t\t\tmainXScaleType === ScaleTypes.TIME;\n\n\t\t// @todo - should check if zoom bar in all axes are locked\n\t\tconst isZoomBarLocked = this.services.zoom.isZoomBarLocked(\n\t\t\tAxisPositions.TOP\n\t\t);\n\n\t\tconst titleAvailable = !!this.model.getOptions().title;\n\t\tconst titleComponent = {\n\t\t\tid: 'title',\n\t\t\tcomponents: [new Title(this.model, this.services)],\n\t\t\tgrowth: {\n\t\t\t\tx: LayoutGrowth.STRETCH,\n\t\t\t\ty: LayoutGrowth.FIXED,\n\t\t\t},\n\t\t};\n\n\t\tconst toolbarComponent = {\n\t\t\tid: 'toolbar',\n\t\t\tcomponents: [new Toolbar(this.model, this.services)],\n\t\t\tgrowth: {\n\t\t\t\tx: LayoutGrowth.PREFERRED,\n\t\t\t\ty: LayoutGrowth.FIXED,\n\t\t\t},\n\t\t};\n\n\t\tconst headerComponent = {\n\t\t\tid: 'header',\n\t\t\tcomponents: [\n\t\t\t\tnew LayoutComponent(\n\t\t\t\t\tthis.model,\n\t\t\t\t\tthis.services,\n\t\t\t\t\t[\n\t\t\t\t\t\t// always add title to keep layout correct\n\t\t\t\t\t\ttitleComponent,\n\t\t\t\t\t\t...(toolbarEnabled ? [toolbarComponent] : []),\n\t\t\t\t\t],\n\t\t\t\t\t{\n\t\t\t\t\t\tdirection: LayoutDirection.ROW,\n\t\t\t\t\t}\n\t\t\t\t),\n\t\t\t],\n\t\t\tgrowth: {\n\t\t\t\tx: LayoutGrowth.PREFERRED,\n\t\t\t\ty: LayoutGrowth.FIXED,\n\t\t\t},\n\t\t};\n\n\t\tconst legendComponent = {\n\t\t\tid: 'legend',\n\t\t\tcomponents: [new Legend(this.model, this.services)],\n\t\t\tgrowth: {\n\t\t\t\tx: LayoutGrowth.PREFERRED,\n\t\t\t\ty: LayoutGrowth.FIXED,\n\t\t\t},\n\t\t};\n\n\t\t// if all zoom bars are locked, no need to add chart brush\n\t\tif (zoomBarEnabled && !isZoomBarLocked) {\n\t\t\tgraphFrameComponents.push(\n\t\t\t\tnew ChartClip(this.model, this.services),\n\t\t\t\tnew ChartBrush(this.model, this.services)\n\t\t\t);\n\t\t}\n\n\t\tgraphFrameComponents.push(new Threshold(this.model, this.services));\n\n\t\tconst graphFrameComponent = {\n\t\t\tid: 'graph-frame',\n\t\t\tcomponents: graphFrameComponents,\n\t\t\tgrowth: {\n\t\t\t\tx: LayoutGrowth.STRETCH,\n\t\t\t\ty: LayoutGrowth.FIXED,\n\t\t\t},\n\t\t};\n\n\t\tconst isLegendEnabled =\n\t\t\tTools.getProperty(configs, 'legend', 'enabled') !== false &&\n\t\t\tthis.model.getOptions().legend.enabled !== false;\n\n\t\t// Decide the position of the legend in reference to the chart\n\t\tlet fullFrameComponentDirection = LayoutDirection.COLUMN;\n\t\tif (isLegendEnabled) {\n\t\t\tconst legendPosition = Tools.getProperty(\n\t\t\t\tthis.model.getOptions(),\n\t\t\t\t'legend',\n\t\t\t\t'position'\n\t\t\t);\n\t\t\tif (legendPosition === LegendPositions.LEFT) {\n\t\t\t\tfullFrameComponentDirection = LayoutDirection.ROW;\n\n\t\t\t\tif (!this.model.getOptions().legend.orientation) {\n\t\t\t\t\tthis.model.getOptions().legend.orientation =\n\t\t\t\t\t\tLegendOrientations.VERTICAL;\n\t\t\t\t}\n\t\t\t} else if (legendPosition === LegendPositions.RIGHT) {\n\t\t\t\tfullFrameComponentDirection = LayoutDirection.ROW_REVERSE;\n\n\t\t\t\tif (!this.model.getOptions().legend.orientation) {\n\t\t\t\t\tthis.model.getOptions().legend.orientation =\n\t\t\t\t\t\tLegendOrientations.VERTICAL;\n\t\t\t\t}\n\t\t\t} else if (legendPosition === LegendPositions.BOTTOM) {\n\t\t\t\tfullFrameComponentDirection = LayoutDirection.COLUMN_REVERSE;\n\t\t\t}\n\t\t}\n\n\t\tconst legendSpacerComponent = {\n\t\t\tid: 'spacer',\n\t\t\tcomponents: [new Spacer(this.model, this.services)],\n\t\t\tgrowth: {\n\t\t\t\tx: LayoutGrowth.PREFERRED,\n\t\t\t\ty: LayoutGrowth.FIXED,\n\t\t\t},\n\t\t};\n\n\t\tconst fullFrameComponent = {\n\t\t\tid: 'full-frame',\n\t\t\tcomponents: [\n\t\t\t\tnew LayoutComponent(\n\t\t\t\t\tthis.model,\n\t\t\t\t\tthis.services,\n\t\t\t\t\t[\n\t\t\t\t\t\t...(isLegendEnabled ? [legendComponent] : []),\n\t\t\t\t\t\t...(isLegendEnabled ? [legendSpacerComponent] : []),\n\t\t\t\t\t\tgraphFrameComponent,\n\t\t\t\t\t],\n\t\t\t\t\t{\n\t\t\t\t\t\tdirection: fullFrameComponentDirection,\n\t\t\t\t\t}\n\t\t\t\t),\n\t\t\t],\n\t\t\tgrowth: {\n\t\t\t\tx: LayoutGrowth.STRETCH,\n\t\t\t\ty: LayoutGrowth.FIXED,\n\t\t\t},\n\t\t};\n\n\t\tconst zoomBarComponent = {\n\t\t\tid: 'zoom-bar',\n\t\t\tcomponents: [new ZoomBar(this.model, this.services)],\n\t\t\tgrowth: {\n\t\t\t\tx: LayoutGrowth.PREFERRED,\n\t\t\t\ty: LayoutGrowth.FIXED,\n\t\t\t},\n\t\t};\n\n\t\tconst topLevelLayoutComponents = [];\n\t\t// header component is required for either title or toolbar\n\t\tif (titleAvailable || toolbarEnabled) {\n\t\t\ttopLevelLayoutComponents.push(headerComponent);\n\n\t\t\tconst titleSpacerComponent = {\n\t\t\t\tid: 'spacer',\n\t\t\t\tcomponents: [\n\t\t\t\t\tnew Spacer(\n\t\t\t\t\t\tthis.model,\n\t\t\t\t\t\tthis.services,\n\t\t\t\t\t\ttoolbarEnabled ? { size: 15 } : undefined\n\t\t\t\t\t),\n\t\t\t\t],\n\t\t\t\tgrowth: {\n\t\t\t\t\tx: LayoutGrowth.PREFERRED,\n\t\t\t\t\ty: LayoutGrowth.FIXED,\n\t\t\t\t},\n\t\t\t};\n\n\t\t\ttopLevelLayoutComponents.push(titleSpacerComponent);\n\t\t}\n\t\tif (zoomBarEnabled) {\n\t\t\ttopLevelLayoutComponents.push(zoomBarComponent);\n\t\t}\n\t\ttopLevelLayoutComponents.push(fullFrameComponent);\n\n\t\treturn [\n\t\t\tnew AxisChartsTooltip(this.model, this.services),\n\t\t\tnew LayoutComponent(\n\t\t\t\tthis.model,\n\t\t\t\tthis.services,\n\t\t\t\ttopLevelLayoutComponents,\n\t\t\t\t{\n\t\t\t\t\tdirection: LayoutDirection.COLUMN,\n\t\t\t\t}\n\t\t\t),\n\t\t];\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"axis-chart.js","sourceRoot":"","sources":["axis-chart.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EACN,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,eAAe,EAGf,aAAa,EACb,UAAU,GACV,MAAM,cAAc,CAAC;AACtB,OAAO,EACN,UAAU,EACV,SAAS,EACT,eAAe,EACf,MAAM,EACN,SAAS,EACT,KAAK,EACL,iBAAiB,EACjB,MAAM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AClB,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,QAAQ,EACb,wBAAwB,EACxB;gBACC,SAAS,EAAE,eAAe,CAAC,MAAM;aACjC,CACD;SACD,CAAC;IACH,CAAC;IACF,gBAAC;AAAD,CAAC,AAlOD,CAA+B,KAAK,GAkOnC","sourcesContent":["import { Chart } from './chart';\nimport { ChartModelCartesian } from './model-cartesian-charts';\nimport {\n\tLayoutDirection,\n\tLayoutGrowth,\n\tLegendOrientations,\n\tLegendPositions,\n\tChartConfig,\n\tAxisChartOptions,\n\tAxisPositions,\n\tScaleTypes,\n} from './interfaces';\nimport {\n\tChartBrush,\n\tChartClip,\n\tLayoutComponent,\n\tLegend,\n\tThreshold,\n\tTitle,\n\tAxisChartsTooltip,\n\tSpacer,\n\tToolbar,\n\tZoomBar,\n} from './components';\nimport { Tools } from './tools';\n\nimport { CartesianScales, Curves, Zoom } from './services';\n\nexport class AxisChart extends Chart {\n\tservices: any = Object.assign(this.services, {\n\t\tcartesianScales: CartesianScales,\n\t\tcurves: Curves,\n\t\tzoom: Zoom,\n\t});\n\tmodel: ChartModelCartesian = new ChartModelCartesian(this.services);\n\n\tconstructor(holder: Element, chartConfigs: ChartConfig<AxisChartOptions>) {\n\t\tsuper(holder, chartConfigs);\n\t}\n\n\tprotected getAxisChartComponents(\n\t\tgraphFrameComponents: any[],\n\t\tconfigs?: object\n\t) {\n\t\tconst options = this.model.getOptions();\n\t\tconst isZoomBarEnabled = Tools.getProperty(\n\t\t\toptions,\n\t\t\t'zoomBar',\n\t\t\tAxisPositions.TOP,\n\t\t\t'enabled'\n\t\t);\n\t\tconst toolbarEnabled = Tools.getProperty(options, 'toolbar', 'enabled');\n\n\t\tthis.services.cartesianScales.determineAxisDuality();\n\t\tthis.services.cartesianScales.findDomainAndRangeAxes(); // need to do this before getMainXAxisPosition()\n\t\tthis.services.cartesianScales.determineOrientation();\n\n\t\tconst mainXAxisPosition = this.services.cartesianScales.getMainXAxisPosition();\n\t\tconst mainXScaleType = Tools.getProperty(\n\t\t\toptions,\n\t\t\t'axes',\n\t\t\tmainXAxisPosition,\n\t\t\t'scaleType'\n\t\t);\n\t\t// @todo - Zoom Bar only supports main axis at BOTTOM axis and time scale for now\n\t\tconst zoomBarEnabled =\n\t\t\tisZoomBarEnabled &&\n\t\t\tmainXAxisPosition === AxisPositions.BOTTOM &&\n\t\t\tmainXScaleType === ScaleTypes.TIME;\n\n\t\t// @todo - should check if zoom bar in all axes are locked\n\t\tconst isZoomBarLocked = this.services.zoom.isZoomBarLocked(\n\t\t\tAxisPositions.TOP\n\t\t);\n\n\t\tconst titleAvailable = !!this.model.getOptions().title;\n\t\tconst titleComponent = {\n\t\t\tid: 'title',\n\t\t\tcomponents: [new Title(this.model, this.services)],\n\t\t\tgrowth: {\n\t\t\t\tx: LayoutGrowth.STRETCH,\n\t\t\t\ty: LayoutGrowth.FIXED,\n\t\t\t},\n\t\t};\n\n\t\tconst toolbarComponent = {\n\t\t\tid: 'toolbar',\n\t\t\tcomponents: [new Toolbar(this.model, this.services)],\n\t\t\tgrowth: {\n\t\t\t\tx: LayoutGrowth.PREFERRED,\n\t\t\t\ty: LayoutGrowth.FIXED,\n\t\t\t},\n\t\t};\n\n\t\tconst headerComponent = {\n\t\t\tid: 'header',\n\t\t\tcomponents: [\n\t\t\t\tnew LayoutComponent(\n\t\t\t\t\tthis.model,\n\t\t\t\t\tthis.services,\n\t\t\t\t\t[\n\t\t\t\t\t\t// always add title to keep layout correct\n\t\t\t\t\t\ttitleComponent,\n\t\t\t\t\t\t...(toolbarEnabled ? [toolbarComponent] : []),\n\t\t\t\t\t],\n\t\t\t\t\t{\n\t\t\t\t\t\tdirection: LayoutDirection.ROW,\n\t\t\t\t\t}\n\t\t\t\t),\n\t\t\t],\n\t\t\tgrowth: {\n\t\t\t\tx: LayoutGrowth.PREFERRED,\n\t\t\t\ty: LayoutGrowth.FIXED,\n\t\t\t},\n\t\t};\n\n\t\tconst legendComponent = {\n\t\t\tid: 'legend',\n\t\t\tcomponents: [new Legend(this.model, this.services)],\n\t\t\tgrowth: {\n\t\t\t\tx: LayoutGrowth.PREFERRED,\n\t\t\t\ty: LayoutGrowth.PREFERRED,\n\t\t\t},\n\t\t};\n\n\t\t// if all zoom bars are locked, no need to add chart brush\n\t\tif (zoomBarEnabled && !isZoomBarLocked) {\n\t\t\tgraphFrameComponents.push(\n\t\t\t\tnew ChartClip(this.model, this.services),\n\t\t\t\tnew ChartBrush(this.model, this.services)\n\t\t\t);\n\t\t}\n\n\t\tgraphFrameComponents.push(new Threshold(this.model, this.services));\n\n\t\tconst graphFrameComponent = {\n\t\t\tid: 'graph-frame',\n\t\t\tcomponents: graphFrameComponents,\n\t\t\tgrowth: {\n\t\t\t\tx: LayoutGrowth.STRETCH,\n\t\t\t\ty: LayoutGrowth.STRETCH,\n\t\t\t},\n\t\t};\n\n\t\tconst isLegendEnabled =\n\t\t\tTools.getProperty(configs, 'legend', 'enabled') !== false &&\n\t\t\tthis.model.getOptions().legend.enabled !== false;\n\n\t\t// Decide the position of the legend in reference to the chart\n\t\tlet fullFrameComponentDirection = LayoutDirection.COLUMN;\n\t\tif (isLegendEnabled) {\n\t\t\tconst legendPosition = Tools.getProperty(\n\t\t\t\tthis.model.getOptions(),\n\t\t\t\t'legend',\n\t\t\t\t'position'\n\t\t\t);\n\t\t\tif (legendPosition === LegendPositions.LEFT) {\n\t\t\t\tfullFrameComponentDirection = LayoutDirection.ROW;\n\n\t\t\t\tif (!this.model.getOptions().legend.orientation) {\n\t\t\t\t\tthis.model.getOptions().legend.orientation =\n\t\t\t\t\t\tLegendOrientations.VERTICAL;\n\t\t\t\t}\n\t\t\t} else if (legendPosition === LegendPositions.RIGHT) {\n\t\t\t\tfullFrameComponentDirection = LayoutDirection.ROW_REVERSE;\n\n\t\t\t\tif (!this.model.getOptions().legend.orientation) {\n\t\t\t\t\tthis.model.getOptions().legend.orientation =\n\t\t\t\t\t\tLegendOrientations.VERTICAL;\n\t\t\t\t}\n\t\t\t} else if (legendPosition === LegendPositions.BOTTOM) {\n\t\t\t\tfullFrameComponentDirection = LayoutDirection.COLUMN_REVERSE;\n\t\t\t}\n\t\t}\n\n\t\tconst legendSpacerComponent = {\n\t\t\tid: 'spacer',\n\t\t\tcomponents: [new Spacer(this.model, this.services)],\n\t\t\tgrowth: {\n\t\t\t\tx: LayoutGrowth.PREFERRED,\n\t\t\t\ty: LayoutGrowth.FIXED,\n\t\t\t},\n\t\t};\n\n\t\tconst fullFrameComponent = {\n\t\t\tid: 'full-frame',\n\t\t\tcomponents: [\n\t\t\t\tnew LayoutComponent(\n\t\t\t\t\tthis.model,\n\t\t\t\t\tthis.services,\n\t\t\t\t\t[\n\t\t\t\t\t\t...(isLegendEnabled ? [legendComponent] : []),\n\t\t\t\t\t\t...(isLegendEnabled ? [legendSpacerComponent] : []),\n\t\t\t\t\t\tgraphFrameComponent,\n\t\t\t\t\t],\n\t\t\t\t\t{\n\t\t\t\t\t\tdirection: fullFrameComponentDirection,\n\t\t\t\t\t}\n\t\t\t\t),\n\t\t\t],\n\t\t\tgrowth: {\n\t\t\t\tx: LayoutGrowth.STRETCH,\n\t\t\t\ty: LayoutGrowth.FIXED,\n\t\t\t},\n\t\t};\n\n\t\tconst zoomBarComponent = {\n\t\t\tid: 'zoom-bar',\n\t\t\tcomponents: [new ZoomBar(this.model, this.services)],\n\t\t\tgrowth: {\n\t\t\t\tx: LayoutGrowth.PREFERRED,\n\t\t\t\ty: LayoutGrowth.FIXED,\n\t\t\t},\n\t\t};\n\n\t\tconst topLevelLayoutComponents = [];\n\t\t// header component is required for either title or toolbar\n\t\tif (titleAvailable || toolbarEnabled) {\n\t\t\ttopLevelLayoutComponents.push(headerComponent);\n\n\t\t\tconst titleSpacerComponent = {\n\t\t\t\tid: 'spacer',\n\t\t\t\tcomponents: [\n\t\t\t\t\tnew Spacer(\n\t\t\t\t\t\tthis.model,\n\t\t\t\t\t\tthis.services,\n\t\t\t\t\t\ttoolbarEnabled ? { size: 15 } : undefined\n\t\t\t\t\t),\n\t\t\t\t],\n\t\t\t\tgrowth: {\n\t\t\t\t\tx: LayoutGrowth.PREFERRED,\n\t\t\t\t\ty: LayoutGrowth.FIXED,\n\t\t\t\t},\n\t\t\t};\n\n\t\t\ttopLevelLayoutComponents.push(titleSpacerComponent);\n\t\t}\n\t\tif (zoomBarEnabled) {\n\t\t\ttopLevelLayoutComponents.push(zoomBarComponent);\n\t\t}\n\t\ttopLevelLayoutComponents.push(fullFrameComponent);\n\n\t\treturn [\n\t\t\tnew AxisChartsTooltip(this.model, this.services),\n\t\t\tnew LayoutComponent(\n\t\t\t\tthis.model,\n\t\t\t\tthis.services,\n\t\t\t\ttopLevelLayoutComponents,\n\t\t\t\t{\n\t\t\t\t\tdirection: LayoutDirection.COLUMN,\n\t\t\t\t}\n\t\t\t),\n\t\t];\n\t}\n}\n"]}
|
package/build/demo/data/bar.d.ts
CHANGED
|
@@ -313,6 +313,27 @@ export declare const simpleHorizontalBarTimeSeriesData: {
|
|
|
313
313
|
date: Date;
|
|
314
314
|
value: number;
|
|
315
315
|
}[];
|
|
316
|
+
export declare const floatingHorizontalBarTimeSeriesData: ({
|
|
317
|
+
group: string;
|
|
318
|
+
date: Date;
|
|
319
|
+
value: number[];
|
|
320
|
+
} | {
|
|
321
|
+
group: string;
|
|
322
|
+
date: Date;
|
|
323
|
+
value: number;
|
|
324
|
+
})[];
|
|
325
|
+
export declare const floatingHorizontalBarTimeSeriesOptions: {
|
|
326
|
+
title: string;
|
|
327
|
+
axes: {
|
|
328
|
+
left: {
|
|
329
|
+
mapsTo: string;
|
|
330
|
+
scaleType: string;
|
|
331
|
+
};
|
|
332
|
+
bottom: {
|
|
333
|
+
mapsTo: string;
|
|
334
|
+
};
|
|
335
|
+
};
|
|
336
|
+
};
|
|
316
337
|
export declare const stackedBarData: {
|
|
317
338
|
group: string;
|
|
318
339
|
key: string;
|
|
@@ -540,3 +561,37 @@ export declare const stackedHorizontalBarSkeletonOptions: {
|
|
|
540
561
|
loading: boolean;
|
|
541
562
|
};
|
|
542
563
|
};
|
|
564
|
+
export declare const floatingBarData: {
|
|
565
|
+
group: string;
|
|
566
|
+
value: number[];
|
|
567
|
+
}[];
|
|
568
|
+
export declare const floatingBarOptions: {
|
|
569
|
+
title: string;
|
|
570
|
+
axes: {
|
|
571
|
+
left: {
|
|
572
|
+
mapsTo: string;
|
|
573
|
+
includeZero: boolean;
|
|
574
|
+
};
|
|
575
|
+
bottom: {
|
|
576
|
+
mapsTo: string;
|
|
577
|
+
scaleType: string;
|
|
578
|
+
};
|
|
579
|
+
};
|
|
580
|
+
};
|
|
581
|
+
export declare const floatingHorizontalBarData: {
|
|
582
|
+
group: string;
|
|
583
|
+
value: number[];
|
|
584
|
+
}[];
|
|
585
|
+
export declare const floatingHorizontalBarOptions: {
|
|
586
|
+
title: string;
|
|
587
|
+
axes: {
|
|
588
|
+
left: {
|
|
589
|
+
mapsTo: string;
|
|
590
|
+
scaleType: string;
|
|
591
|
+
};
|
|
592
|
+
bottom: {
|
|
593
|
+
mapsTo: string;
|
|
594
|
+
includeZero: boolean;
|
|
595
|
+
};
|
|
596
|
+
};
|
|
597
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare const basicBulletData: {
|
|
2
|
+
title: string;
|
|
3
|
+
group: string;
|
|
4
|
+
ranges: number[];
|
|
5
|
+
marker: number;
|
|
6
|
+
value: number;
|
|
7
|
+
}[];
|
|
8
|
+
export declare const basicBulletOptions: {
|
|
9
|
+
title: string;
|
|
10
|
+
axes: {
|
|
11
|
+
bottom: {
|
|
12
|
+
mapsTo: string;
|
|
13
|
+
extendLinearDomainBy: string;
|
|
14
|
+
};
|
|
15
|
+
left: {
|
|
16
|
+
scaleType: string;
|
|
17
|
+
mapsTo: string;
|
|
18
|
+
};
|
|
19
|
+
right: {
|
|
20
|
+
scaleType: string;
|
|
21
|
+
mapsTo: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
legend: {
|
|
25
|
+
additionalItems: {
|
|
26
|
+
type: string;
|
|
27
|
+
name: string;
|
|
28
|
+
}[];
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AxisChart } from '../axis-chart';
|
|
2
|
+
import { ChartConfig, BulletChartOptions } from '../interfaces/index';
|
|
3
|
+
export declare class BulletChart extends AxisChart {
|
|
4
|
+
constructor(holder: Element, chartConfigs: ChartConfig<BulletChartOptions>);
|
|
5
|
+
getComponents(): any[];
|
|
6
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Component } from '../component';
|
|
2
|
+
export declare class Bullet extends Component {
|
|
3
|
+
type: string;
|
|
4
|
+
init(): void;
|
|
5
|
+
render(animate: boolean): void;
|
|
6
|
+
handleLegendOnHover: (event: CustomEvent<any>) => void;
|
|
7
|
+
handleLegendMouseOut: (event: CustomEvent<any>) => void;
|
|
8
|
+
getMatchingRangeIndexForDatapoint(datum: any): any;
|
|
9
|
+
addEventListeners(): void;
|
|
10
|
+
destroy(): void;
|
|
11
|
+
}
|
|
@@ -12,6 +12,7 @@ export * from './graphs/bar-grouped';
|
|
|
12
12
|
export * from './graphs/bar-stacked';
|
|
13
13
|
export * from './graphs/boxplot';
|
|
14
14
|
export * from './graphs/bubble';
|
|
15
|
+
export * from './graphs/bullet';
|
|
15
16
|
export * from './graphs/line';
|
|
16
17
|
export * from './graphs/lollipop';
|
|
17
18
|
export * from './graphs/scatter';
|
|
@@ -22,6 +22,10 @@ export declare const axis: {
|
|
|
22
22
|
verticalSpaceRatio: number;
|
|
23
23
|
horizontalSpaceRatio: number;
|
|
24
24
|
};
|
|
25
|
+
ratio: {
|
|
26
|
+
reference: string;
|
|
27
|
+
compareTo: string;
|
|
28
|
+
};
|
|
25
29
|
paddingRatio: number;
|
|
26
30
|
};
|
|
27
31
|
export declare const boxplot: {
|
|
@@ -93,7 +97,6 @@ export declare const legend: {
|
|
|
93
97
|
y: number;
|
|
94
98
|
width: number;
|
|
95
99
|
height: number;
|
|
96
|
-
color: string;
|
|
97
100
|
}[];
|
|
98
101
|
};
|
|
99
102
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseChartOptions, AxisChartOptions, ScatterChartOptions, LollipopChartOptions, LineChartOptions, BarChartOptions, StackedBarChartOptions, BoxplotChartOptions, AreaChartOptions, PieChartOptions, GaugeChartOptions, DonutChartOptions, BubbleChartOptions, RadarChartOptions, ComboChartOptions, TreemapChartOptions, WorldCloudChartOptions, GridOptions, RulerOptions, TimeScaleOptions, TooltipOptions, MeterChartOptions } from './interfaces';
|
|
1
|
+
import { BaseChartOptions, AxisChartOptions, ScatterChartOptions, LollipopChartOptions, LineChartOptions, BarChartOptions, StackedBarChartOptions, BoxplotChartOptions, AreaChartOptions, PieChartOptions, GaugeChartOptions, DonutChartOptions, BubbleChartOptions, BulletChartOptions, RadarChartOptions, ComboChartOptions, TreemapChartOptions, WorldCloudChartOptions, GridOptions, RulerOptions, TimeScaleOptions, TooltipOptions, MeterChartOptions } from './interfaces';
|
|
2
2
|
/**
|
|
3
3
|
* Grid options
|
|
4
4
|
*/
|
|
@@ -20,6 +20,7 @@ export declare const options: {
|
|
|
20
20
|
stackedBarChart: StackedBarChartOptions;
|
|
21
21
|
boxplotChart: BoxplotChartOptions;
|
|
22
22
|
bubbleChart: BubbleChartOptions;
|
|
23
|
+
bulletChart: BulletChartOptions;
|
|
23
24
|
lineChart: LineChartOptions;
|
|
24
25
|
areaChart: AreaChartOptions;
|
|
25
26
|
stackedAreaChart: AreaChartOptions;
|
|
@@ -28,6 +28,13 @@ export interface AxisOptions {
|
|
|
28
28
|
* No need to define domain for percentage axis scale
|
|
29
29
|
*/
|
|
30
30
|
domain?: AxisDomain[];
|
|
31
|
+
/**
|
|
32
|
+
* an additional key from the charting data that is used to
|
|
33
|
+
* extend the domain of an axis by
|
|
34
|
+
* (e.g. in the bullet graph we need both the marker &
|
|
35
|
+
* the data values to define the domain of the linear scale)
|
|
36
|
+
*/
|
|
37
|
+
extendLinearDomainBy?: string;
|
|
31
38
|
/**
|
|
32
39
|
* Whether the Axis should be forced to include 0 as a starting point
|
|
33
40
|
* (or ending point, in case of all negative axis).
|
|
@@ -181,6 +181,17 @@ export interface BubbleChartOptions extends AxisChartOptions {
|
|
|
181
181
|
enabled?: boolean;
|
|
182
182
|
};
|
|
183
183
|
}
|
|
184
|
+
/**
|
|
185
|
+
* options specific to bullet charts
|
|
186
|
+
*/
|
|
187
|
+
export interface BulletChartOptions extends AxisChartOptions {
|
|
188
|
+
/**
|
|
189
|
+
* options for the individual bullets
|
|
190
|
+
*/
|
|
191
|
+
bullet?: {
|
|
192
|
+
performanceAreaTitles?: string[];
|
|
193
|
+
};
|
|
194
|
+
}
|
|
184
195
|
/**
|
|
185
196
|
* options specific to line charts
|
|
186
197
|
*/
|