@carbon/charts 0.41.40 → 0.41.41

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.
@@ -52,7 +52,7 @@ var Meter = /** @class */ (function (_super) {
52
52
  // if user provided a color for the bar, we dont want to attach a status class
53
53
  var className = status != null && !self.model.isUserProvidedColorScaleValid()
54
54
  ? "value status--" + status
55
- : '';
55
+ : 'value';
56
56
  // draw the value bar
57
57
  value
58
58
  .enter()
@@ -1 +1 @@
1
- {"version":3,"file":"meter.js","sourceRoot":"","sources":["meter.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mBAAmB;AACnB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE9D,aAAa;AACb,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC;IAA2B,yBAAS;IAApC;QAAA,qEA2GC;QA1GA,UAAI,GAAG,OAAO,CAAC;;IA0GhB,CAAC;IAxGA,sBAAM,GAAN,UAAO,OAAc;QAArB,iBAuGC;QAvGM,wBAAA,EAAA,cAAc;QACpB,IAAM,IAAI,GAAG,IAAI,CAAC;QAClB,IAAM,GAAG,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QACnC,IAAM,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QAClC,IAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC;QACzC,IAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC;QAE9B,IAAA;;gBAAK,CAEV;QACK,IAAA,sCAAW,CAAkB;QAErC,0DAA0D;QAC1D,IAAM,MAAM,GAAG,WAAW,EAAE,CAAC,MAAM,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I,CAAC,QAAQ,CAAC,CAAC;QAEvD,IAAI,CAAC,KAAK,EAAE;aACV,MAAM,CAAC,MAAM,CAAC;aACd,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC;aACrB,KAAK,CAAC,IAAI,CAAC;aACX,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;aACb,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;aACzD,UAAU,CACV,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,aAAa,CACtC,kBAAkB,EAClB,OAAO,CACP,CACD;aACA,IAAI,CAAC,IAAI,EAAE,UAAC,CAAC,IAAK,OAAA,MAAM,CAAC,CAAC,CAAC,EAAT,CAAS,CAAC;aAC5B,IAAI,CAAC,IAAI,EAAE,UAAC,CAAC,IAAK,OAAA,MAAM,CAAC,CAAC,CAAC,EAAT,CAAS,CAAC;YAC7B,OAAO;aACN,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,eAAe,CAAC;aACnC,IAAI,CAAC,sBAAsB,EAAE,MAAM,CAAC;aACpC,IAAI,CAAC,YAAY,EAAE,UAAC,CAAC,IAAK,OAAA,CAAC,EAAD,CAAC,CAAC,CAAC;QAE/B,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,CAAC;QAErB,kGAAkG;QAClG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,eAAe,EAAE,CAAC;IAC1C,CAAC;IACF,YAAC;AAAD,CAAC,AA3GD,CAA2B,SAAS,GA2GnC","sourcesContent":["// Internal Imports\nimport { Component } from '../component';\nimport { DOMUtils } from '../../services';\nimport { Tools } from '../../tools';\nimport { Roles, ColorClassNameTypes } from '../../interfaces';\n\n// D3 Imports\nimport { scaleLinear } from 'd3-scale';\n\nexport class Meter extends Component {\n\ttype = 'meter';\n\n\trender(animate = true) {\n\t\tconst self = this;\n\t\tconst svg = this.getContainerSVG();\n\t\tconst options = this.getOptions();\n\t\tconst data = this.model.getDisplayData();\n\t\tconst status = this.model.getStatus();\n\n\t\tconst { width } = DOMUtils.getSVGElementSize(this.parent, {\n\t\t\tuseAttrs: true,\n\t\t});\n\t\tconst { groupMapsTo } = options.data;\n\n\t\t// each meter has a scale for the value but no visual axis\n\t\tconst xScale = scaleLinear().domain([0, 100]).range([0, width]);\n\n\t\t// draw the container to hold the value\n\t\tDOMUtils.appendOrSelect(svg, 'rect.container')\n\t\t\t.attr('x', 0)\n\t\t\t.attr('y', 0)\n\t\t\t.attr('width', width)\n\t\t\t.attr('height', Tools.getProperty(options, 'meter', 'height'));\n\n\t\t// value larger than 100 will display as 100% on meter chart\n\t\tconst maximumBarWidth = data.value >= 100;\n\n\t\t// rect with the value binded\n\t\tconst value = svg.selectAll('rect.value').data([data]);\n\n\t\t// if user provided a color for the bar, we dont want to attach a status class\n\t\tconst className =\n\t\t\tstatus != null && !self.model.isUserProvidedColorScaleValid()\n\t\t\t\t? `value status--${status}`\n\t\t\t\t: '';\n\n\t\t// draw the value bar\n\t\tvalue\n\t\t\t.enter()\n\t\t\t.append('rect')\n\t\t\t.classed('value', true)\n\t\t\t.merge(value)\n\t\t\t.attr('x', 0)\n\t\t\t.attr('y', 0)\n\t\t\t.attr('height', Tools.getProperty(options, 'meter', 'height'))\n\t\t\t.attr('class', (d) =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL],\n\t\t\t\t\tdataGroupName: d[groupMapsTo],\n\t\t\t\t\toriginalClassName: className,\n\t\t\t\t})\n\t\t\t)\n\t\t\t.transition(\n\t\t\t\tthis.services.transitions.getTransition(\n\t\t\t\t\t'meter-bar-update',\n\t\t\t\t\tanimate\n\t\t\t\t)\n\t\t\t)\n\t\t\t.attr('width', (d) =>\n\t\t\t\tmaximumBarWidth ? xScale(100) : xScale(d.value)\n\t\t\t)\n\t\t\t.style('fill', (d) => self.model.getFillColor(d[groupMapsTo]))\n\t\t\t// a11y\n\t\t\t.attr('role', Roles.GRAPHICS_SYMBOL)\n\t\t\t.attr('aria-roledescription', 'value')\n\t\t\t.attr('aria-label', (d) => d.value);\n\n\t\t// draw the peak\n\t\tconst peakValue = Tools.getProperty(options, 'meter', 'peak');\n\n\t\t// update the peak if it is less than the value, it should be equal to the value\n\t\tconst updatedPeak =\n\t\t\tpeakValue !== null && peakValue < data.value\n\t\t\t\t? data.value\n\t\t\t\t: peakValue;\n\t\t// dont display peak if there isnt one\n\t\tconst peakData =\n\t\t\tupdatedPeak === null || maximumBarWidth ? [] : [updatedPeak];\n\n\t\t// if a peak is supplied within the domain, we want to render it\n\t\tconst peak = svg.selectAll('line.peak').data(peakData);\n\n\t\tpeak.enter()\n\t\t\t.append('line')\n\t\t\t.classed('peak', true)\n\t\t\t.merge(peak)\n\t\t\t.attr('y1', 0)\n\t\t\t.attr('y2', Tools.getProperty(options, 'meter', 'height'))\n\t\t\t.transition(\n\t\t\t\tthis.services.transitions.getTransition(\n\t\t\t\t\t'peak-line-update',\n\t\t\t\t\tanimate\n\t\t\t\t)\n\t\t\t)\n\t\t\t.attr('x1', (d) => xScale(d))\n\t\t\t.attr('x2', (d) => xScale(d))\n\t\t\t// a11y\n\t\t\t.attr('role', Roles.GRAPHICS_SYMBOL)\n\t\t\t.attr('aria-roledescription', 'peak')\n\t\t\t.attr('aria-label', (d) => d);\n\n\t\tpeak.exit().remove();\n\n\t\t// this forces the meter chart to only take up as much height as needed (if no height is provided)\n\t\tthis.services.domUtils.setSVGMaxHeight();\n\t}\n}\n"]}
1
+ {"version":3,"file":"meter.js","sourceRoot":"","sources":["meter.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mBAAmB;AACnB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,mBAAm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AC7B,OAAO;aACN,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,eAAe,CAAC;aACnC,IAAI,CAAC,sBAAsB,EAAE,MAAM,CAAC;aACpC,IAAI,CAAC,YAAY,EAAE,UAAC,CAAC,IAAK,OAAA,CAAC,EAAD,CAAC,CAAC,CAAC;QAE/B,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,CAAC;QAErB,kGAAkG;QAClG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,eAAe,EAAE,CAAC;IAC1C,CAAC;IACF,YAAC;AAAD,CAAC,AA3GD,CAA2B,SAAS,GA2GnC","sourcesContent":["// Internal Imports\nimport { Component } from '../component';\nimport { DOMUtils } from '../../services';\nimport { Tools } from '../../tools';\nimport { Roles, ColorClassNameTypes } from '../../interfaces';\n\n// D3 Imports\nimport { scaleLinear } from 'd3-scale';\n\nexport class Meter extends Component {\n\ttype = 'meter';\n\n\trender(animate = true) {\n\t\tconst self = this;\n\t\tconst svg = this.getContainerSVG();\n\t\tconst options = this.getOptions();\n\t\tconst data = this.model.getDisplayData();\n\t\tconst status = this.model.getStatus();\n\n\t\tconst { width } = DOMUtils.getSVGElementSize(this.parent, {\n\t\t\tuseAttrs: true,\n\t\t});\n\t\tconst { groupMapsTo } = options.data;\n\n\t\t// each meter has a scale for the value but no visual axis\n\t\tconst xScale = scaleLinear().domain([0, 100]).range([0, width]);\n\n\t\t// draw the container to hold the value\n\t\tDOMUtils.appendOrSelect(svg, 'rect.container')\n\t\t\t.attr('x', 0)\n\t\t\t.attr('y', 0)\n\t\t\t.attr('width', width)\n\t\t\t.attr('height', Tools.getProperty(options, 'meter', 'height'));\n\n\t\t// value larger than 100 will display as 100% on meter chart\n\t\tconst maximumBarWidth = data.value >= 100;\n\n\t\t// rect with the value binded\n\t\tconst value = svg.selectAll('rect.value').data([data]);\n\n\t\t// if user provided a color for the bar, we dont want to attach a status class\n\t\tconst className =\n\t\t\tstatus != null && !self.model.isUserProvidedColorScaleValid()\n\t\t\t\t? `value status--${status}`\n\t\t\t\t: 'value';\n\n\t\t// draw the value bar\n\t\tvalue\n\t\t\t.enter()\n\t\t\t.append('rect')\n\t\t\t.classed('value', true)\n\t\t\t.merge(value)\n\t\t\t.attr('x', 0)\n\t\t\t.attr('y', 0)\n\t\t\t.attr('height', Tools.getProperty(options, 'meter', 'height'))\n\t\t\t.attr('class', (d) =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL],\n\t\t\t\t\tdataGroupName: d[groupMapsTo],\n\t\t\t\t\toriginalClassName: className,\n\t\t\t\t})\n\t\t\t)\n\t\t\t.transition(\n\t\t\t\tthis.services.transitions.getTransition(\n\t\t\t\t\t'meter-bar-update',\n\t\t\t\t\tanimate\n\t\t\t\t)\n\t\t\t)\n\t\t\t.attr('width', (d) =>\n\t\t\t\tmaximumBarWidth ? xScale(100) : xScale(d.value)\n\t\t\t)\n\t\t\t.style('fill', (d) => self.model.getFillColor(d[groupMapsTo]))\n\t\t\t// a11y\n\t\t\t.attr('role', Roles.GRAPHICS_SYMBOL)\n\t\t\t.attr('aria-roledescription', 'value')\n\t\t\t.attr('aria-label', (d) => d.value);\n\n\t\t// draw the peak\n\t\tconst peakValue = Tools.getProperty(options, 'meter', 'peak');\n\n\t\t// update the peak if it is less than the value, it should be equal to the value\n\t\tconst updatedPeak =\n\t\t\tpeakValue !== null && peakValue < data.value\n\t\t\t\t? data.value\n\t\t\t\t: peakValue;\n\t\t// dont display peak if there isnt one\n\t\tconst peakData =\n\t\t\tupdatedPeak === null || maximumBarWidth ? [] : [updatedPeak];\n\n\t\t// if a peak is supplied within the domain, we want to render it\n\t\tconst peak = svg.selectAll('line.peak').data(peakData);\n\n\t\tpeak.enter()\n\t\t\t.append('line')\n\t\t\t.classed('peak', true)\n\t\t\t.merge(peak)\n\t\t\t.attr('y1', 0)\n\t\t\t.attr('y2', Tools.getProperty(options, 'meter', 'height'))\n\t\t\t.transition(\n\t\t\t\tthis.services.transitions.getTransition(\n\t\t\t\t\t'peak-line-update',\n\t\t\t\t\tanimate\n\t\t\t\t)\n\t\t\t)\n\t\t\t.attr('x1', (d) => xScale(d))\n\t\t\t.attr('x2', (d) => xScale(d))\n\t\t\t// a11y\n\t\t\t.attr('role', Roles.GRAPHICS_SYMBOL)\n\t\t\t.attr('aria-roledescription', 'peak')\n\t\t\t.attr('aria-label', (d) => d);\n\n\t\tpeak.exit().remove();\n\n\t\t// this forces the meter chart to only take up as much height as needed (if no height is provided)\n\t\tthis.services.domUtils.setSVGMaxHeight();\n\t}\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carbon/charts",
3
- "version": "0.41.40",
3
+ "version": "0.41.41",
4
4
  "description": "Carbon charting components",
5
5
  "main": "./bundle.js",
6
6
  "module": "./index.js",
@@ -586,7 +586,7 @@
586
586
  "signature": "9ffb57dbb13765ec0a8aaf132b587b1a28010c0c85a2040a45246f5beae07152"
587
587
  },
588
588
  "../src/components/graphs/meter.ts": {
589
- "version": "f978c9f924135d7ab00ee16195670bebffa63f3f4251d1837167f1504464ed5d",
589
+ "version": "e5b0670b92987226d0676c88eec4cd795ba0e91c598499a5e9f279ff427e6fae",
590
590
  "signature": "76fb4bde3d69c3d47d813bd1accf7779ac7196136e8891d3d99c76610842f407"
591
591
  },
592
592
  "../src/charts/meter.ts": {