@carbon/charts 0.29.1 → 0.29.2
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 +8 -0
- package/LICENSE.md +201 -0
- package/{src/axis-chart.d.ts → axis-chart.d.ts} +0 -0
- package/{src/axis-chart.js → axis-chart.js} +9 -2
- package/axis-chart.js.map +1 -0
- package/bundle.js +1 -25
- package/{src/chart.d.ts → chart.d.ts} +0 -0
- package/{src/chart.js → chart.js} +9 -2
- package/chart.js.map +1 -0
- package/{src/charts → charts}/bar-grouped.d.ts +0 -0
- package/{src/charts → charts}/bar-grouped.js +1 -1
- package/{src/charts → charts}/bar-grouped.js.map +0 -0
- package/{src/charts → charts}/bar-simple.d.ts +0 -0
- package/{src/charts → charts}/bar-simple.js +1 -1
- package/{src/charts → charts}/bar-simple.js.map +0 -0
- package/{src/charts → charts}/bar-stacked.d.ts +0 -0
- package/{src/charts → charts}/bar-stacked.js +1 -1
- package/{src/charts → charts}/bar-stacked.js.map +0 -0
- package/{src/charts → charts}/bubble.d.ts +0 -0
- package/{src/charts → charts}/bubble.js +1 -1
- package/{src/charts → charts}/bubble.js.map +0 -0
- package/{src/charts → charts}/donut.d.ts +0 -0
- package/{src/charts → charts}/donut.js +1 -1
- package/{src/charts → charts}/donut.js.map +0 -0
- package/{src/charts → charts}/index.d.ts +0 -0
- package/{src/charts → charts}/index.js +1 -1
- package/{src/charts → charts}/index.js.map +0 -0
- package/{src/charts → charts}/line.d.ts +0 -0
- package/{src/charts → charts}/line.js +1 -1
- package/{src/charts → charts}/line.js.map +0 -0
- package/{src/charts → charts}/pie.d.ts +0 -0
- package/{src/charts → charts}/pie.js +1 -1
- package/{src/charts → charts}/pie.js.map +0 -0
- package/{src/charts → charts}/scatter.d.ts +0 -0
- package/{src/charts → charts}/scatter.js +1 -1
- package/{src/charts → charts}/scatter.js.map +0 -0
- package/{src/components → components}/axes/axis.d.ts +0 -0
- package/{src/components → components}/axes/axis.js +1 -1
- package/{src/components → components}/axes/axis.js.map +0 -0
- package/{src/components → components}/axes/grid.d.ts +0 -0
- package/{src/components → components}/axes/grid.js +1 -1
- package/{src/components → components}/axes/grid.js.map +0 -0
- package/{src/components → components}/axes/two-dimensional-axes.d.ts +0 -0
- package/{src/components → components}/axes/two-dimensional-axes.js +1 -1
- package/{src/components → components}/axes/two-dimensional-axes.js.map +0 -0
- package/{src/components → components}/axes/zero-line.d.ts +0 -0
- package/{src/components → components}/axes/zero-line.js +1 -1
- package/{src/components → components}/axes/zero-line.js.map +0 -0
- package/{src/components → components}/component.d.ts +0 -0
- package/{src/components → components}/component.js +1 -1
- package/{src/components → components}/component.js.map +0 -0
- package/{src/components → components}/essentials/legend.d.ts +0 -0
- package/{src/components → components}/essentials/legend.js +1 -1
- package/{src/components → components}/essentials/legend.js.map +0 -0
- package/{src/components → components}/essentials/title.d.ts +0 -0
- package/{src/components → components}/essentials/title.js +1 -1
- package/{src/components → components}/essentials/title.js.map +0 -0
- package/{src/components → components}/essentials/tooltip-bar.d.ts +0 -0
- package/{src/components → components}/essentials/tooltip-bar.js +1 -1
- package/{src/components → components}/essentials/tooltip-bar.js.map +0 -0
- package/{src/components → components}/essentials/tooltip-scatter.d.ts +0 -0
- package/{src/components → components}/essentials/tooltip-scatter.js +1 -1
- package/{src/components → components}/essentials/tooltip-scatter.js.map +0 -0
- package/{src/components → components}/essentials/tooltip.d.ts +0 -0
- package/{src/components → components}/essentials/tooltip.js +1 -1
- package/{src/components → components}/essentials/tooltip.js.map +0 -0
- package/{src/components → components}/graphs/bar-grouped.d.ts +0 -0
- package/{src/components → components}/graphs/bar-grouped.js +1 -1
- package/{src/components → components}/graphs/bar-grouped.js.map +0 -0
- package/{src/components → components}/graphs/bar-simple.d.ts +0 -0
- package/{src/components → components}/graphs/bar-simple.js +1 -1
- package/{src/components → components}/graphs/bar-simple.js.map +0 -0
- package/{src/components → components}/graphs/bar-stacked.d.ts +0 -0
- package/{src/components → components}/graphs/bar-stacked.js +1 -1
- package/{src/components → components}/graphs/bar-stacked.js.map +0 -0
- package/{src/components → components}/graphs/bar.d.ts +0 -0
- package/{src/components → components}/graphs/bar.js +1 -1
- package/{src/components → components}/graphs/bar.js.map +0 -0
- package/{src/components → components}/graphs/bubble.d.ts +0 -0
- package/{src/components → components}/graphs/bubble.js +1 -1
- package/{src/components → components}/graphs/bubble.js.map +0 -0
- package/{src/components → components}/graphs/donut.d.ts +0 -0
- package/{src/components → components}/graphs/donut.js +1 -1
- package/{src/components → components}/graphs/donut.js.map +0 -0
- package/{src/components → components}/graphs/line.d.ts +0 -0
- package/{src/components → components}/graphs/line.js +1 -1
- package/{src/components → components}/graphs/line.js.map +0 -0
- package/{src/components → components}/graphs/pie.d.ts +0 -0
- package/{src/components → components}/graphs/pie.js +1 -1
- package/{src/components → components}/graphs/pie.js.map +0 -0
- package/{src/components → components}/graphs/scatter.d.ts +0 -0
- package/{src/components → components}/graphs/scatter.js +1 -1
- package/{src/components → components}/graphs/scatter.js.map +0 -0
- package/{src/components → components}/index.d.ts +0 -0
- package/{src/components → components}/index.js +1 -1
- package/{src/components → components}/index.js.map +0 -0
- package/{src/components → components}/layout/layout.d.ts +0 -0
- package/{src/components → components}/layout/layout.js +1 -1
- package/{src/components → components}/layout/layout.js.map +0 -0
- package/{src/components → components}/layout/spacer.d.ts +0 -0
- package/{src/components → components}/layout/spacer.js +1 -1
- package/{src/components → components}/layout/spacer.js.map +0 -0
- package/{src/configuration.d.ts → configuration.d.ts} +0 -0
- package/{src/configuration.js → configuration.js} +1 -1
- package/{src/configuration.js.map → configuration.js.map} +0 -0
- package/demo/demo-data/bundle.js +1 -0
- package/demo/demo-data/create-codesandbox.d.ts +2 -2
- package/demo/demo-data/create-codesandbox.js +1 -1
- package/demo/demo-data/create-codesandbox.js.map +1 -1
- package/demo/demo-data/step.js +1 -1
- package/demo/demo-data/step.js.map +1 -1
- package/demo/demo-options.d.ts +2 -0
- package/demo/demo-options.js +43 -0
- package/demo/demo-options.js.map +1 -0
- package/demo/index.d.ts +1 -0
- package/demo/index.js +128 -0
- package/demo/index.js.map +1 -0
- package/demo/tsconfig.tsbuildinfo +2801 -0
- package/{src/index.d.ts → index.d.ts} +0 -0
- package/index.js +9 -25
- package/{src/index.js.map → index.js.map} +0 -0
- package/{src/interfaces → interfaces}/a11y.d.ts +0 -0
- package/{src/interfaces → interfaces}/a11y.js +1 -1
- package/{src/interfaces → interfaces}/a11y.js.map +0 -0
- package/{src/interfaces → interfaces}/axis-scales.d.ts +0 -0
- package/interfaces/axis-scales.js +1 -0
- package/{src/interfaces → interfaces}/axis-scales.js.map +0 -0
- package/{src/interfaces → interfaces}/charts.d.ts +0 -0
- package/interfaces/charts.js +1 -0
- package/{src/interfaces → interfaces}/charts.js.map +0 -0
- package/{src/interfaces → interfaces}/components.d.ts +0 -0
- package/interfaces/components.js +1 -0
- package/{src/interfaces → interfaces}/components.js.map +0 -0
- package/{src/interfaces → interfaces}/enums.d.ts +0 -0
- package/{src/interfaces → interfaces}/enums.js +1 -1
- package/{src/interfaces → interfaces}/enums.js.map +0 -0
- package/{src/interfaces → interfaces}/events.d.ts +0 -0
- package/{src/interfaces → interfaces}/events.js +1 -1
- package/{src/interfaces → interfaces}/events.js.map +0 -0
- package/{src/interfaces → interfaces}/index.d.ts +0 -0
- package/interfaces/index.js +3 -0
- package/{src/interfaces → interfaces}/index.js.map +0 -0
- package/{src/interfaces → interfaces}/layout.d.ts +0 -0
- package/interfaces/layout.js +1 -0
- package/{src/interfaces → interfaces}/layout.js.map +0 -0
- package/{src/interfaces → interfaces}/model.d.ts +0 -0
- package/interfaces/model.js +1 -0
- package/{src/interfaces → interfaces}/model.js.map +0 -0
- package/{src/model-pie.d.ts → model-pie.d.ts} +0 -0
- package/{src/model-pie.js → model-pie.js} +1 -1
- package/{src/model-pie.js.map → model-pie.js.map} +0 -0
- package/{src/model-simple-bar.d.ts → model-simple-bar.d.ts} +0 -0
- package/{src/model-simple-bar.js → model-simple-bar.js} +1 -1
- package/{src/model-simple-bar.js.map → model-simple-bar.js.map} +0 -0
- package/{src/model.d.ts → model.d.ts} +0 -0
- package/{src/model.js → model.js} +1 -1
- package/{src/model.js.map → model.js.map} +0 -0
- package/package.json +12 -8
- package/{src/polyfills.d.ts → polyfills.d.ts} +0 -0
- package/{src/polyfills.js → polyfills.js} +1 -1
- package/{src/polyfills.js.map → polyfills.js.map} +0 -0
- package/{src/services → services}/colorPalettes.d.ts +0 -0
- package/{src/services → services}/colorPalettes.js +1 -1
- package/{src/services → services}/colorPalettes.js.map +0 -0
- package/{src/services → services}/colors.d.ts +0 -0
- package/{src/services → services}/colors.js +1 -1
- package/{src/services → services}/colors.js.map +0 -0
- package/{src/services → services}/curves.d.ts +0 -0
- package/{src/services → services}/curves.js +1 -1
- package/{src/services → services}/curves.js.map +0 -0
- package/{src/services → services}/essentials/dom-utils.d.ts +0 -0
- package/{src/services → services}/essentials/dom-utils.js +1 -1
- package/{src/services → services}/essentials/dom-utils.js.map +0 -0
- package/{src/services → services}/essentials/events.d.ts +0 -0
- package/{src/services → services}/essentials/events.js +1 -1
- package/{src/services → services}/essentials/events.js.map +0 -0
- package/{src/services → services}/essentials/transitions.d.ts +0 -0
- package/{src/services → services}/essentials/transitions.js +1 -1
- package/{src/services → services}/essentials/transitions.js.map +0 -0
- package/{src/services → services}/index.d.ts +0 -0
- package/{src/services → services}/index.js +1 -1
- package/{src/services → services}/index.js.map +0 -0
- package/{src/services → services}/scales-cartesian.d.ts +0 -0
- package/{src/services → services}/scales-cartesian.js +1 -1
- package/{src/services → services}/scales-cartesian.js.map +0 -0
- package/{src/services → services}/service.d.ts +0 -0
- package/{src/services → services}/service.js +1 -1
- package/{src/services → services}/service.js.map +0 -0
- package/{src/tools.d.ts → tools.d.ts} +16 -15
- package/{src/tools.js → tools.js} +1 -1
- package/{src/tools.js.map → tools.js.map} +0 -0
- package/tsconfig.tsbuildinfo +3102 -0
- package/src/axis-chart.js.map +0 -1
- package/src/chart.js.map +0 -1
- package/src/index.js +0 -9
- package/src/interfaces/axis-scales.js +0 -1
- package/src/interfaces/charts.js +0 -1
- package/src/interfaces/components.js +0 -1
- package/src/interfaces/index.js +0 -3
- package/src/interfaces/layout.js +0 -1
- package/src/interfaces/model.js +0 -1
- package/src/tests/index.d.ts +0 -1
- package/src/tests/index.js +0 -2
- package/src/tests/index.js.map +0 -1
- package/src/tests/test-environment.d.ts +0 -13
- package/src/tests/test-environment.js +0 -32
- package/src/tests/test-environment.js.map +0 -1
- package/src/tests/tools.d.ts +0 -3
- package/src/tests/tools.js +0 -13
- package/src/tests/tools.js.map +0 -1
package/src/axis-chart.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"axis-chart.js","sourceRoot":"","sources":["axis-chart.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EACN,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,eAAe,EAGf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACN,eAAe,EACf,MAAM,EACN,KAAK,EAGL,MAAM,EACN,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE3D;IAA+B,6BAAK;IAMnC,mBAAY,MAAe,EAAE,YAA2C;QAAxE,YACC,kBAAM,MAAM,EAAE,YAAY,CAAC,SAC3B;QAPD,cAAQ,GAAQ,MAAM,CAAC,MAAM,CAAC,KAAI,CAAC,QAAQ,EAAE;YAC5C,eAAe,EAAE,eAAe;YAChC,MAAM,EAAE,MAAM;SACd,CAAC,CAAC;;IAIH,CAAC;IAES,0CAAsB,GAAhC,UAAiC,oBAA2B;QAC3D,IAAM,cAAc,GAAG;YACtB,EAAE,EAAE,OAAO;YACX,UAAU,EAAE;gBACX,IAAI,KAAK,CAAC,IAAI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B,GAAG;gBAC5B,EAAE,EAAE,QAAQ;gBACZ,UAAU,EAAE;oBACX,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC;iBACrC;gBACD,MAAM,EAAE;oBACP,CAAC,EAAE,YAAY,CAAC,SAAS;oBACzB,CAAC,EAAE,YAAY,CAAC,KAAK;iBACrB;aACD,CAAC;YAEF,wBAAwB,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;SACpD;QACD,wBAAwB,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;QAElD,OAAO;YACN,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,AAjID,CAA+B,KAAK,GAiInC","sourcesContent":["import { Chart } from \"./chart\";\nimport {\n\tLayoutDirection,\n\tLayoutGrowth,\n\tLegendOrientations,\n\tLegendPositions,\n\tChartConfig,\n\tAxisChartOptions\n} from \"./interfaces/index\";\nimport {\n\tLayoutComponent,\n\tLegend,\n\tTitle,\n\tTooltip,\n\tTooltipBar,\n\tSpacer\n} from \"./components/index\";\nimport { Tools } from \"./tools\";\n\nimport { CartesianScales, Curves } from \"./services/index\";\n\nexport class AxisChart extends Chart {\n\tservices: any = Object.assign(this.services, {\n\t\tcartesianScales: CartesianScales,\n\t\tcurves: Curves\n\t});\n\n\tconstructor(holder: Element, chartConfigs: ChartConfig<AxisChartOptions>) {\n\t\tsuper(holder, chartConfigs);\n\t}\n\n\tprotected getAxisChartComponents(graphFrameComponents: any[]) {\n\t\tconst titleComponent = {\n\t\t\tid: \"title\",\n\t\t\tcomponents: [\n\t\t\t\tnew Title(this.model, this.services)\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: [\n\t\t\t\tnew Legend(this.model, this.services)\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 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 = this.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(this.model.getOptions(), \"legend\", \"position\");\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 = LegendOrientations.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 = LegendOrientations.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: [\n\t\t\t\tnew Spacer(this.model, this.services)\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 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\tlegendSpacerComponent,\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\t// Add chart title if it exists\n\t\tconst topLevelLayoutComponents = [];\n\t\tif (this.model.getOptions().title) {\n\t\t\ttopLevelLayoutComponents.push(titleComponent);\n\n\t\t\tconst titleSpacerComponent = {\n\t\t\t\tid: \"spacer\",\n\t\t\t\tcomponents: [\n\t\t\t\t\tnew Spacer(this.model, this.services)\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\ttopLevelLayoutComponents.push(fullFrameComponent);\n\n\t\treturn [\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/src/chart.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chart.js","sourceRoot":"","sources":["chart.ts"],"names":[],"mappings":"AAAA,mBAAmB;AAC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CAAC,QAAQ,EACb,wBAAwB,EACxB;gBACC,SAAS,EAAE,eAAe,CAAC,MAAM;aACjC,CACD;SACD,CAAC;IACH,CAAC;IACF,YAAC;AAAD,CAAC,AAlND,IAkNC","sourcesContent":["// Internal Imports\nimport {\n\tChartConfig,\n\tBaseChartOptions,\n\tLayoutGrowth,\n\tLayoutDirection,\n\tLegendOrientations,\n\tChartTheme\n} from \"./interfaces/index\";\n\n// Misc\nimport { ChartModel } from \"./model\";\nimport { Component,\n\tTitle,\n\tLegend,\n\tLayoutComponent,\n\tTooltip,\n\tSpacer\n} from \"./components\";\nimport { Tools } from \"./tools\";\n\n// Services\nimport {\n\tDOMUtils,\n\tEvents,\n\tTransitions\n} from \"./services/index\";\n\nexport class Chart {\n\tcomponents: Component[];\n\tservices: any = {\n\t\tdomUtils: DOMUtils,\n\t\tevents: Events,\n\t\ttransitions: Transitions\n\t};\n\tmodel: ChartModel = new ChartModel(this.services);\n\n\tconstructor(holder: Element, chartConfigs: ChartConfig<BaseChartOptions>) {}\n\n\t// Contains the code that uses properties that are overridable by the super-class\n\tinit(holder: Element, chartConfigs: ChartConfig<BaseChartOptions>) {\n\t\t// Store the holder in the model\n\t\tthis.model.set({ holder }, true);\n\n\t\t// Initialize all services\n\t\tObject.keys(this.services).forEach(serviceName => {\n\t\t\tconst serviceObj = this.services[serviceName];\n\t\t\tthis.services[serviceName] = new serviceObj(this.model, this.services);\n\t\t});\n\n\t\t// Call update() when model has been updated\n\t\tthis.services.events\n\t\t\t.addEventListener(\"model-update\", () => {\n\t\t\t\tthis.update(true);\n\t\t\t});\n\n\t\t// Set model data & options\n\t\tthis.model.setData(chartConfigs.data);\n\n\t\t// Set chart resize event listener\n\t\tthis.services.events\n\t\t\t.addEventListener(\"chart-resize\", () => {\n\t\t\t\tthis.update(false);\n\t\t\t});\n\n\t\tthis.components = this.getComponents();\n\n\t\tthis.update();\n\t}\n\n\tgetComponents(): any[] {\n\t\tconsole.error(\"getComponents() method is not implemented\");\n\n\t\treturn null;\n\t}\n\n\n\n\tupdate(animate = true) {\n\t\tif (!this.components) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Update all services\n\t\tObject.keys(this.services).forEach(serviceName => {\n\t\t\tconst serviceObj = this.services[serviceName];\n\t\t\tserviceObj.update();\n\t\t});\n\n\t\t// Render all components\n\t\tthis.components.forEach(component => component.render(animate));\n\n\t\t// Asynchronously dispatch a \"render-finished\" event\n\t\t// This is needed because of d3-transitions\n\t\t// Since at the start of the transition\n\t\t// Elements do not hold their final size or position\n\t\tconst pendingTransitions = this.services.transitions.getPendingTransitions();\n\t\tconst promises = Object.keys(pendingTransitions)\n\t\t\t.map(transitionID => {\n\t\t\t\tconst transition = pendingTransitions[transitionID];\n\t\t\t\treturn transition.end()\n\t\t\t\t\t.catch(e => e); // Skip rejects since we don't care about those;\n\t\t\t});\n\n\t\tPromise.all(promises)\n\t\t\t.then(() => this.services.events.dispatchEvent(\"render-finished\"));\n\t}\n\n\tdestroy() {\n\t\t// Call the destroy() method on all components\n\t\tthis.components.forEach(component => component.destroy());\n\n\t\t// Remove the chart holder\n\t\tthis.services.domUtils.getHolder().remove();\n\n\t\tthis.model.set({ destroyed: true }, true);\n\t}\n\n\n\tprotected getChartComponents(graphFrameComponents: any[]) {\n\t\tconst titleComponent = {\n\t\t\tid: \"title\",\n\t\t\tcomponents: [\n\t\t\t\tnew Title(this.model, this.services)\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: [\n\t\t\t\tnew Legend(this.model, this.services)\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 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 = this.model.getOptions().legend.enabled !== false;\n\t\t// TODORF - REUSE BETWEEN AXISCHART & CHART\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\t\tconst legendPosition = Tools.getProperty(this.model.getOptions(), \"legend\", \"position\");\n\t\t\tif (legendPosition === \"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 = LegendOrientations.VERTICAL;\n\t\t\t\t}\n\t\t\t} else if (legendPosition === \"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 = LegendOrientations.VERTICAL;\n\t\t\t\t}\n\t\t\t} else if (legendPosition === \"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: [\n\t\t\t\tnew Spacer(this.model, this.services)\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 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\tlegendSpacerComponent,\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\t// Add chart title if it exists\n\t\tconst topLevelLayoutComponents = [];\n\t\tif (this.model.getOptions().title) {\n\t\t\ttopLevelLayoutComponents.push(titleComponent);\n\n\t\t\tconst titleSpacerComponent = {\n\t\t\t\tid: \"spacer\",\n\t\t\t\tcomponents: [\n\t\t\t\t\tnew Spacer(this.model, this.services)\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\ttopLevelLayoutComponents.push(fullFrameComponent);\n\n\t\treturn [\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/src/index.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { SimpleBarChart, GroupedBarChart, StackedBarChart, BubbleChart, LineChart, ScatterChart, PieChart, DonutChart, } from "./charts/index";
|
|
2
|
-
// Configs & interfaces
|
|
3
|
-
import * as configurations from "./configuration";
|
|
4
|
-
import * as interfaces from "./interfaces";
|
|
5
|
-
import * as colorPalettes from "./services/colorPalettes";
|
|
6
|
-
// TODO 1.0 - Remove deprecated API
|
|
7
|
-
var defaultColors = colorPalettes.DEFAULT;
|
|
8
|
-
export { interfaces, configurations, defaultColors, colorPalettes, SimpleBarChart, GroupedBarChart, StackedBarChart, BubbleChart, LineChart, ScatterChart, PieChart, DonutChart };
|
|
9
|
-
//# sourceMappingURL=../../src/index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=../../../src/interfaces/axis-scales.js.map
|
package/src/interfaces/charts.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=../../../src/interfaces/charts.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=../../../src/interfaces/components.js.map
|
package/src/interfaces/index.js
DELETED
package/src/interfaces/layout.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=../../../src/interfaces/layout.js.map
|
package/src/interfaces/model.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=../../../src/interfaces/model.js.map
|
package/src/tests/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./test-environment";
|
package/src/tests/index.js
DELETED
package/src/tests/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC","sourcesContent":["export * from \"./test-environment\";\n"]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Chart } from "../chart";
|
|
2
|
-
import * as Charts from "../index";
|
|
3
|
-
export declare const data: Charts.interfaces.ChartData;
|
|
4
|
-
export declare const options: any;
|
|
5
|
-
export declare class TestEnvironment {
|
|
6
|
-
chartOptions: any;
|
|
7
|
-
chartData: Charts.interfaces.ChartData;
|
|
8
|
-
chart: Chart;
|
|
9
|
-
render(): void;
|
|
10
|
-
destroy(): void;
|
|
11
|
-
setChartOptions(func: Function): void;
|
|
12
|
-
getChartReference(): Chart;
|
|
13
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import * as Charts from "../index";
|
|
2
|
-
import { createChartHolder } from "./tools";
|
|
3
|
-
import { groupedBarData, groupedBarOptions } from "../../demo/demo-data";
|
|
4
|
-
export var data = groupedBarData;
|
|
5
|
-
export var options = Object.assign(groupedBarOptions, {
|
|
6
|
-
title: "My chart"
|
|
7
|
-
});
|
|
8
|
-
var TestEnvironment = /** @class */ (function () {
|
|
9
|
-
function TestEnvironment() {
|
|
10
|
-
this.chartOptions = options;
|
|
11
|
-
this.chartData = data;
|
|
12
|
-
}
|
|
13
|
-
TestEnvironment.prototype.render = function () {
|
|
14
|
-
var holder = createChartHolder("scatter");
|
|
15
|
-
this.chart = new Charts.ScatterChart(holder, {
|
|
16
|
-
data: this.chartData,
|
|
17
|
-
options: this.chartOptions
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
TestEnvironment.prototype.destroy = function () {
|
|
21
|
-
this.chart.destroy();
|
|
22
|
-
};
|
|
23
|
-
TestEnvironment.prototype.setChartOptions = function (func) {
|
|
24
|
-
this.chartOptions = func(this.chartOptions);
|
|
25
|
-
};
|
|
26
|
-
TestEnvironment.prototype.getChartReference = function () {
|
|
27
|
-
return this.chart;
|
|
28
|
-
};
|
|
29
|
-
return TestEnvironment;
|
|
30
|
-
}());
|
|
31
|
-
export { TestEnvironment };
|
|
32
|
-
//# sourceMappingURL=../../../src/tests/test-environment.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test-environment.js","sourceRoot":"","sources":["test-environment.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAI5C,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzE,MAAM,CAAC,IAAM,IAAI,GAAG,cAA2B,CAAC;AAChD,MAAM,CAAC,IAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE;IACvD,KAAK,EAAE,UAAU;CACjB,CAAQ,CAAC;AAEV;IAAA;QACC,iBAAY,GAAG,OAAO,CAAC;QACvB,cAAS,GAAG,IAAI,CAAC;IA0BlB,CAAC;IAvBA,gCAAM,GAAN;QACC,IAAM,MAAM,GAAG,iBAAiB,CAAC,SAAS,CAAC,CAAC;QAE5C,IAAI,CAAC,KAAK,GAAG,IAAI,MAAM,CAAC,YAAY,CACnC,MAAM,EACN;YACC,IAAI,EAAE,IAAI,CAAC,SAAS;YACpB,OAAO,EAAE,IAAI,CAAC,YAAY;SAC1B,CACD,CAAC;IACH,CAAC;IAED,iCAAO,GAAP;QACC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;IACtB,CAAC;IAED,yCAAe,GAAf,UAAgB,IAAc;QAC7B,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC7C,CAAC;IAED,2CAAiB,GAAjB;QACC,OAAO,IAAI,CAAC,KAAK,CAAC;IACnB,CAAC;IACF,sBAAC;AAAD,CAAC,AA5BD,IA4BC","sourcesContent":["import { Chart } from \"../chart\";\n\nimport * as Charts from \"../index\";\nimport { createChartHolder } from \"./tools\";\n\nimport { ChartData } from \"../interfaces\";\n\nimport { groupedBarData, groupedBarOptions } from \"../../demo/demo-data\";\n\nexport const data = groupedBarData as ChartData;\nexport const options = Object.assign(groupedBarOptions, {\n\ttitle: \"My chart\"\n}) as any;\n\nexport class TestEnvironment {\n\tchartOptions = options;\n\tchartData = data;\n\tchart: Chart;\n\n\trender() {\n\t\tconst holder = createChartHolder(\"scatter\");\n\n\t\tthis.chart = new Charts.ScatterChart(\n\t\t\tholder,\n\t\t\t{\n\t\t\t\tdata: this.chartData,\n\t\t\t\toptions: this.chartOptions\n\t\t\t}\n\t\t);\n\t}\n\n\tdestroy() {\n\t\tthis.chart.destroy();\n\t}\n\n\tsetChartOptions(func: Function) {\n\t\tthis.chartOptions = func(this.chartOptions);\n\t}\n\n\tgetChartReference() {\n\t\treturn this.chart;\n\t}\n}\n"]}
|
package/src/tests/tools.d.ts
DELETED
package/src/tests/tools.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// import the settings for the css prefix
|
|
2
|
-
import settings from "carbon-components/src/globals/js/settings";
|
|
3
|
-
// Functions
|
|
4
|
-
export var makeChartID = function (chartType) { return chartType + "-chart-holder"; };
|
|
5
|
-
export var createChartHolder = function (chartType) {
|
|
6
|
-
var chartHolder = document.createElement("div");
|
|
7
|
-
chartHolder.id = makeChartID(chartType);
|
|
8
|
-
chartHolder.classList.add(settings.prefix + "--chart-holder");
|
|
9
|
-
document.body.appendChild(chartHolder);
|
|
10
|
-
return chartHolder;
|
|
11
|
-
};
|
|
12
|
-
export var getChartHolder = function (chartType) { return document.getElementById(makeChartID(chartType)); };
|
|
13
|
-
//# sourceMappingURL=../../../src/tests/tools.js.map
|
package/src/tests/tools.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tools.js","sourceRoot":"","sources":["tools.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,OAAO,QAAQ,MAAM,2CAA2C,CAAC;AAEjE,YAAY;AACZ,MAAM,CAAC,IAAM,WAAW,GAAG,UAAA,SAAS,IAAI,OAAG,SAAS,kBAAe,EAA3B,CAA2B,CAAC;AACpE,MAAM,CAAC,IAAM,iBAAiB,GAAG,UAAA,SAAS;IACzC,IAAM,WAAW,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAClD,WAAW,CAAC,EAAE,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;IACxC,WAAW,CAAC,SAAS,CAAC,GAAG,CAAI,QAAQ,CAAC,MAAM,mBAAgB,CAAC,CAAC;IAE9D,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IAEvC,OAAO,WAAW,CAAC;AACpB,CAAC,CAAC;AAEF,MAAM,CAAC,IAAM,cAAc,GAAG,UAAA,SAAS,IAAI,OAAA,QAAQ,CAAC,cAAc,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,EAA/C,CAA+C,CAAC","sourcesContent":["// import the settings for the css prefix\nimport settings from \"carbon-components/src/globals/js/settings\";\n\n// Functions\nexport const makeChartID = chartType => `${chartType}-chart-holder`;\nexport const createChartHolder = chartType => {\n\tconst chartHolder = document.createElement(\"div\");\n\tchartHolder.id = makeChartID(chartType);\n\tchartHolder.classList.add(`${settings.prefix}--chart-holder`);\n\n\tdocument.body.appendChild(chartHolder);\n\n\treturn chartHolder;\n};\n\nexport const getChartHolder = chartType => document.getElementById(makeChartID(chartType));\n"]}
|