@carbon/charts 0.32.9 → 0.33.0
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 +331 -145
- package/README.md +18 -8
- package/axis-chart.js +20 -20
- package/axis-chart.js.map +1 -1
- package/build/demo/data/area.d.ts +17 -0
- package/build/demo/data/bar.d.ts +71 -0
- package/build/demo/data/line.d.ts +55 -0
- package/build/demo/data/scatter.d.ts +18 -0
- package/build/src/components/essentials/tooltip-bar.d.ts +2 -2
- package/build/src/components/essentials/tooltip-radar.d.ts +2 -1
- package/build/src/components/essentials/tooltip.d.ts +2 -2
- package/build/src/interfaces/axis-scales.d.ts +2 -0
- package/build/src/interfaces/charts.d.ts +5 -0
- package/build/src/interfaces/components.d.ts +2 -0
- package/build/src/interfaces/enums.d.ts +12 -1
- package/build/src/interfaces/truncation.d.ts +17 -0
- package/build/src/model.d.ts +1 -0
- package/build/src/tools.d.ts +9 -0
- package/bundle.js +1 -1
- package/charts/area-stacked.js +3 -3
- package/charts/area-stacked.js.map +1 -1
- package/charts/area.js +3 -3
- package/charts/area.js.map +1 -1
- package/charts/bar-grouped.js +3 -3
- package/charts/bar-grouped.js.map +1 -1
- package/charts/bar-simple.js +3 -3
- package/charts/bar-simple.js.map +1 -1
- package/charts/bar-stacked.js +3 -3
- package/charts/bar-stacked.js.map +1 -1
- package/charts/bubble.js +3 -3
- package/charts/bubble.js.map +1 -1
- package/charts/donut.js +3 -3
- package/charts/donut.js.map +1 -1
- package/charts/gauge.js +2 -1
- package/charts/gauge.js.map +1 -1
- package/charts/line.js +3 -3
- package/charts/line.js.map +1 -1
- package/charts/pie.js +3 -3
- package/charts/pie.js.map +1 -1
- package/charts/radar.js +1 -1
- package/charts/radar.js.map +1 -1
- package/charts/scatter.js +3 -3
- package/charts/scatter.js.map +1 -1
- package/components/axes/axis.js +76 -14
- package/components/axes/axis.js.map +1 -1
- package/components/axes/grid.js +1 -1
- package/components/axes/grid.js.map +1 -1
- package/components/axes/ruler.js +2 -2
- package/components/axes/ruler.js.map +1 -1
- package/components/axes/two-dimensional-axes.js +3 -3
- package/components/axes/two-dimensional-axes.js.map +1 -1
- package/components/axes/zero-line.js +1 -1
- package/components/axes/zero-line.js.map +1 -1
- package/components/essentials/legend.js +53 -11
- package/components/essentials/legend.js.map +1 -1
- package/components/essentials/threshold.js +9 -9
- package/components/essentials/threshold.js.map +1 -1
- package/components/essentials/title.js +2 -2
- package/components/essentials/title.js.map +1 -1
- package/components/essentials/tooltip-bar.d.ts +2 -2
- package/components/essentials/tooltip-bar.js +24 -10
- package/components/essentials/tooltip-bar.js.map +1 -1
- package/components/essentials/tooltip-pie.js +3 -0
- package/components/essentials/tooltip-pie.js.map +1 -1
- package/components/essentials/tooltip-radar.d.ts +2 -1
- package/components/essentials/tooltip-radar.js +1 -1
- package/components/essentials/tooltip-radar.js.map +1 -1
- package/components/essentials/tooltip-scatter.js +6 -0
- package/components/essentials/tooltip-scatter.js.map +1 -1
- package/components/essentials/tooltip.d.ts +2 -2
- package/components/essentials/tooltip.js +16 -11
- package/components/essentials/tooltip.js.map +1 -1
- package/components/graphs/area-stacked.js +8 -7
- package/components/graphs/area-stacked.js.map +1 -1
- package/components/graphs/bar-grouped.js +7 -7
- package/components/graphs/bar-grouped.js.map +1 -1
- package/components/graphs/bar-simple.js +6 -6
- package/components/graphs/bar-simple.js.map +1 -1
- package/components/graphs/bar-stacked.js +6 -6
- package/components/graphs/bar-stacked.js.map +1 -1
- package/components/graphs/gauge.js +7 -5
- package/components/graphs/gauge.js.map +1 -1
- package/components/graphs/line.js +14 -10
- package/components/graphs/line.js.map +1 -1
- package/components/graphs/pie.js +12 -12
- package/components/graphs/pie.js.map +1 -1
- package/components/graphs/radar.js +11 -11
- package/components/graphs/radar.js.map +1 -1
- package/components/graphs/scatter-stacked.js +2 -4
- package/components/graphs/scatter-stacked.js.map +1 -1
- package/components/graphs/scatter.js +6 -8
- package/components/graphs/scatter.js.map +1 -1
- package/components/graphs/skeleton.js +3 -3
- package/components/graphs/skeleton.js.map +1 -1
- package/components/layout/layout.js +10 -4
- package/components/layout/layout.js.map +1 -1
- package/configuration.js +26 -8
- package/configuration.js.map +1 -1
- package/demo/create-codesandbox.js +19 -19
- package/demo/create-codesandbox.js.map +1 -1
- package/demo/data/area.d.ts +17 -0
- package/demo/data/area.js +26 -0
- package/demo/data/area.js.map +1 -1
- package/demo/data/bar.d.ts +71 -0
- package/demo/data/bar.js +176 -95
- package/demo/data/bar.js.map +1 -1
- package/demo/data/bubble.js +29 -29
- package/demo/data/bubble.js.map +1 -1
- package/demo/data/bundle.js +1 -1
- package/demo/data/index.js +39 -1
- package/demo/data/index.js.map +1 -1
- package/demo/data/line.d.ts +55 -0
- package/demo/data/line.js +149 -50
- package/demo/data/line.js.map +1 -1
- package/demo/data/pie.js +5 -5
- package/demo/data/pie.js.map +1 -1
- package/demo/data/radar.js +12 -12
- package/demo/data/radar.js.map +1 -1
- package/demo/data/scatter.d.ts +18 -0
- package/demo/data/scatter.js +73 -22
- package/demo/data/scatter.js.map +1 -1
- package/demo/data/step.js +6 -6
- package/demo/data/step.js.map +1 -1
- package/demo/data/time-series-axis.js +107 -107
- package/demo/data/time-series-axis.js.map +1 -1
- package/demo/styles.css +32 -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 +50 -27
- package/interfaces/a11y.js.map +1 -1
- package/interfaces/axis-scales.d.ts +2 -0
- package/interfaces/axis-scales.js.map +1 -1
- package/interfaces/charts.d.ts +5 -0
- package/interfaces/charts.js.map +1 -1
- package/interfaces/components.d.ts +2 -0
- package/interfaces/components.js.map +1 -1
- package/interfaces/enums.d.ts +12 -1
- package/interfaces/enums.js +12 -0
- package/interfaces/enums.js.map +1 -1
- package/interfaces/events.js.map +1 -1
- package/interfaces/truncation.d.ts +17 -0
- package/interfaces/truncation.js +1 -0
- package/interfaces/truncation.js.map +1 -0
- package/model.d.ts +1 -0
- package/model.js +61 -5
- package/model.js.map +1 -1
- package/package.json +1 -1
- package/polyfills.js +1 -1
- package/polyfills.js.map +1 -1
- package/services/angle-utils.js +8 -8
- package/services/angle-utils.js.map +1 -1
- package/services/colorPalettes.js +2 -2
- package/services/colorPalettes.js.map +1 -1
- package/services/colors.js +1 -1
- package/services/colors.js.map +1 -1
- package/services/curves.js +2 -2
- package/services/curves.js.map +1 -1
- package/services/essentials/dom-utils.js +6 -6
- package/services/essentials/dom-utils.js.map +1 -1
- package/services/essentials/events.js +1 -1
- package/services/essentials/events.js.map +1 -1
- package/services/scales-cartesian.js +17 -17
- package/services/scales-cartesian.js.map +1 -1
- package/services/time-series.js +2 -2
- package/services/time-series.js.map +1 -1
- package/styles/components/_tooltip.scss +2 -0
- package/styles-g10.css +8 -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 +8 -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 +8 -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 +8 -0
- package/styles.css.map +1 -1
- package/styles.min.css +1 -1
- package/styles.min.css.map +1 -1
- package/tools.d.ts +9 -0
- package/tools.js +32 -7
- package/tools.js.map +1 -1
- package/tsconfig.tsbuildinfo +87 -69
package/styles-g90.min.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.bx--cc--axes g.axis g.ticks.invisible{visibility:hidden}.bx--cc--axes g.axis g.tick text{fill:#bebebe;font-family:'IBM Plex Sans Condensed', 'Helvetica Neue', Arial, sans-serif}.bx--cc--axes g.axis g.tick line{display:none}.bx--cc--axes g.axis path.domain{stroke:#8c8c8c}.bx--cc--chart-svg g.callouts{stroke:#bebebe}.bx--cc--grid rect.chart-grid-backdrop{fill:#282828;stroke:#565656}.bx--cc--grid g.x.grid g.tick line,.bx--cc--grid g.y.grid g.tick line{pointer-events:none;stroke-width:1px;stroke:#565656}.bx--cc--grid g.x.grid g.tick.active line,.bx--cc--grid g.y.grid g.tick.active line{stroke-dasharray:2px;stroke:#fff}.bx--cc--ruler line.ruler-line{stroke:#fff;stroke-width:1px;stroke-dasharray:2;pointer-events:none}.bx--cc--ruler text.axis-tooltip-text{fill:#fff;dominant-baseline:middle;text-anchor:middle}.bx--cc--skeleton rect.chart-skeleton-backdrop{fill:#282828}.bx--cc--skeleton .shimmer-effect-lines{stroke-width:1px;stroke:url(#shimmer-lines)}.bx--cc--skeleton .empty-state-lines{stroke-width:1px;stroke:#565656}.bx--cc--skeleton #shimmer-lines .stop-bg-shimmer{stop-color:#565656}.bx--cc--skeleton #shimmer-lines .stop-shimmer{stop-color:#fff}.bx--cc--skeleton .shimmer-effect-areas{fill:url(#shimmer-areas)}.bx--cc--skeleton .empty-state-areas{fill:rgba(127,127,127,.1)}.bx--cc--skeleton #shimmer-areas .stop-bg-shimmer{stop-color:rgba(127,127,127,.1)}.bx--cc--skeleton #shimmer-areas .stop-shimmer{stop-color:rgba(255,255,255,.15)}.bx--cc--zero-line line.domain{stroke:#8c8c8c}.bx--cc--chart-svg svg.layout-child{overflow:visible}g.bx--cc--legend{user-select:none}g.bx--cc--legend g.legend-item rect.checkbox{stroke-width:1px;stroke-opacity:1}g.bx--cc--legend g.legend-item rect.checkbox:not(.active){stroke:#bebebe;fill:#282828}g.bx--cc--legend g.legend-item rect.checkbox:not(.active)~g.check{display:none}g.bx--cc--legend g.legend-item rect.hover-stroke{fill:none;stroke:#0f62fe;stroke-width:2}g.bx--cc--legend g.legend-item g.check>svg path{fill:#282828;stroke:#282828}g.bx--cc--legend g.legend-item text{font-size:12px;fill:#bebebe}g.bx--cc--legend.clickable g.legend-item:hover{cursor:pointer}.bx--cc--title text.title{fill:#f3f3f3;font-size:16px;font-family:'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;font-weight:600}.bx--cc--tooltip{background-color:#565656;pointer-events:none;transition:opacity .1s;transition-timing-function:cubic-bezier(0.4, 0.14, 0.3, 1);display:inline;box-shadow:0 1px 6px 0 rgba(0,0,0,.2);position:absolute;word-wrap:break-word;z-index:1059;font-family:'IBM Plex Sans Condensed', 'Helvetica Neue', Arial, sans-serif}.bx--cc--tooltip.hidden{opacity:0;transition:opacity .1s;transition-timing-function:cubic-bezier(0.4, 0.14, 0.3, 1)}.bx--cc--tooltip .content-box{color:#f3f3f3}.bx--cc--tooltip .content-box .title-tooltip{line-height:16px;font-size:12px;padding:4px;min-width:20px}.bx--cc--tooltip .content-box .datapoint-tooltip,.bx--cc--tooltip .content-box .total-val{display:flex;padding:4px;flex-flow:row nowrap;width:auto;min-width:20px;justify-content:flex-start;align-items:center}.bx--cc--tooltip .content-box .datapoint-tooltip p,.bx--cc--tooltip .content-box .total-val p{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:16px;font-size:12px;display:inline-block;margin:0;padding:0;border:0}.bx--cc--tooltip .content-box .datapoint-tooltip p.label,.bx--cc--tooltip .content-box .total-val p.label{flex:1;margin-right:8px}.bx--cc--tooltip .content-box .datapoint-tooltip p.value,.bx--cc--tooltip .content-box .total-val p.value{width:auto}.bx--cc--tooltip .content-box .total-val{font-weight:600}.bx--cc--tooltip .content-box .total-val .label{margin-left:4px}.bx--cc--tooltip .content-box ul.multi-tooltip{margin:0;padding:0}.bx--cc--tooltip .content-box ul.multi-tooltip li{list-style:none;position:relative}.bx--cc--tooltip .content-box ul.multi-tooltip li:not(:last-child){border-bottom:1px solid #565656}.bx--cc--tooltip .tooltip-color{position:absolute;left:0;top:0;width:4px;height:100%}.bx--cc--tooltip .tooltip-color+p.label{margin-left:4px}.bx--cc--threshold line.threshold-line{stroke:#fa4d56;stroke-width:1;stroke-dasharray:4;cursor:pointer;pointer-events:none}.bx--cc--threshold.active line.threshold-line{stroke-width:2}.bx--cc--threshold rect.threshold-hoverable-area{height:20px;transform:translate(0, -10px);cursor:pointer;fill:transparent}.bx--cc--threshold rect.threshold-hoverable-area.rotate{transform:rotate(90deg) translate(0, -10px)}.bx--cc--threshold--label{background-color:#fa4d56;pointer-events:none;transition:opacity .1s;transition-timing-function:cubic-bezier(0.4, 0.14, 0.3, 1);display:inline;box-shadow:0 1px 6px 0 rgba(0,0,0,.2);position:absolute;word-wrap:break-word;z-index:1059;font-family:'IBM Plex Sans Condensed', 'Helvetica Neue', Arial, sans-serif;color:#f3f3f3;line-height:16px;font-size:12px;padding:4px;min-width:20px}.bx--cc--threshold--label.hidden{opacity:0;transition:opacity .1s;transition-timing-function:cubic-bezier(0.4, 0.14, 0.3, 1)}.bx--cc--area path.area,.bx--cc--area-stacked path.area{pointer-events:none}g.bx--cc--bubble circle.dot.hovered{fill-opacity:1;transition:all .1s;transition-timing-function:cubic-bezier(0.4, 0.14, 0.3, 1)}g.bx--cc--bubble circle.dot.unfilled{fill:#3d3d3d}g.bx--cc--bubble g.lines path.line{mix-blend-mode:multiply}.bx--cc--line path.line{pointer-events:none;fill:none;stroke-width:1.5}g.bx--cc--scatter circle.dot.hovered{fill-opacity:1;transition:all .1s;transition-timing-function:cubic-bezier(0.4, 0.14, 0.3, 1)}g.bx--cc--scatter circle.dot.unfilled{fill:#3d3d3d;stroke-width:1.5}g.bx--cc--scatter circle.dot.threshold-anomaly{stroke-width:3}g.bx--cc--scatter g.lines path.line{mix-blend-mode:multiply}.bx--cc--radar .blobs path{stroke-width:1.5px}.bx--cc--radar .y-axes path,.bx--cc--radar .x-axes line{stroke-width:1px;stroke:#565656}.bx--cc--radar .x-axes line.hovered{stroke:#fff}.bx--cc--gauge path.arc-background{fill:#3d3d3d}.bx--cc--gauge .gauge-delta-arrow.status--danger{fill:#fb4b53}.bx--cc--gauge .gauge-delta-arrow.status--warning{fill:#fdd13a}.bx--cc--gauge .gauge-delta-arrow.status--success{fill:#3dbb61}svg.bx--cc--chart-svg{font-family:'IBM Plex Sans Condensed', 'Helvetica Neue', Arial, sans-serif}svg.bx--cc--chart-svg text{font-size:12px;font-weight:400;fill:#bebebe}.bx--chart-holder{position:relative;display:block;width:100%;height:100%;background-color:#282828}svg.bx--cc--chart-svg{overflow:visible}/*# sourceMappingURL=styles-g90.min.css.map */
|
|
1
|
+
.bx--cc--axes g.axis g.ticks.invisible{visibility:hidden}.bx--cc--axes g.axis g.tick text{fill:#bebebe;font-family:'IBM Plex Sans Condensed', 'Helvetica Neue', Arial, sans-serif}.bx--cc--axes g.axis g.tick line{display:none}.bx--cc--axes g.axis path.domain{stroke:#8c8c8c}.bx--cc--chart-svg g.callouts{stroke:#bebebe}.bx--cc--grid rect.chart-grid-backdrop{fill:#282828;stroke:#565656}.bx--cc--grid g.x.grid g.tick line,.bx--cc--grid g.y.grid g.tick line{pointer-events:none;stroke-width:1px;stroke:#565656}.bx--cc--grid g.x.grid g.tick.active line,.bx--cc--grid g.y.grid g.tick.active line{stroke-dasharray:2px;stroke:#fff}.bx--cc--ruler line.ruler-line{stroke:#fff;stroke-width:1px;stroke-dasharray:2;pointer-events:none}.bx--cc--ruler text.axis-tooltip-text{fill:#fff;dominant-baseline:middle;text-anchor:middle}.bx--cc--skeleton rect.chart-skeleton-backdrop{fill:#282828}.bx--cc--skeleton .shimmer-effect-lines{stroke-width:1px;stroke:url(#shimmer-lines)}.bx--cc--skeleton .empty-state-lines{stroke-width:1px;stroke:#565656}.bx--cc--skeleton #shimmer-lines .stop-bg-shimmer{stop-color:#565656}.bx--cc--skeleton #shimmer-lines .stop-shimmer{stop-color:#fff}.bx--cc--skeleton .shimmer-effect-areas{fill:url(#shimmer-areas)}.bx--cc--skeleton .empty-state-areas{fill:rgba(127,127,127,.1)}.bx--cc--skeleton #shimmer-areas .stop-bg-shimmer{stop-color:rgba(127,127,127,.1)}.bx--cc--skeleton #shimmer-areas .stop-shimmer{stop-color:rgba(255,255,255,.15)}.bx--cc--zero-line line.domain{stroke:#8c8c8c}.bx--cc--chart-svg svg.layout-child{overflow:visible}g.bx--cc--legend{user-select:none}g.bx--cc--legend g.legend-item rect.checkbox{stroke-width:1px;stroke-opacity:1}g.bx--cc--legend g.legend-item rect.checkbox:not(.active){stroke:#bebebe;fill:#282828}g.bx--cc--legend g.legend-item rect.checkbox:not(.active)~g.check{display:none}g.bx--cc--legend g.legend-item rect.hover-stroke{fill:none;stroke:#0f62fe;stroke-width:2}g.bx--cc--legend g.legend-item g.check>svg path{fill:#282828;stroke:#282828}g.bx--cc--legend g.legend-item text{font-size:12px;fill:#bebebe}g.bx--cc--legend.clickable g.legend-item:hover{cursor:pointer}.bx--cc--title text.title{fill:#f3f3f3;font-size:16px;font-family:'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;font-weight:600}.bx--cc--tooltip{background-color:#565656;pointer-events:none;transition:opacity .1s;transition-timing-function:cubic-bezier(0.4, 0.14, 0.3, 1);display:inline;box-shadow:0 1px 6px 0 rgba(0,0,0,.2);position:absolute;word-wrap:break-word;z-index:1059;font-family:'IBM Plex Sans Condensed', 'Helvetica Neue', Arial, sans-serif}.bx--cc--tooltip.hidden{opacity:0;transition:opacity .1s;transition-timing-function:cubic-bezier(0.4, 0.14, 0.3, 1)}.bx--cc--tooltip .content-box{color:#f3f3f3}.bx--cc--tooltip .content-box .title-tooltip{line-height:16px;font-size:12px;padding:4px;min-width:20px}.bx--cc--tooltip .content-box .datapoint-tooltip,.bx--cc--tooltip .content-box .legend-tooltip,.bx--cc--tooltip .content-box .axis-tooltip,.bx--cc--tooltip .content-box .total-val{display:flex;padding:4px;flex-flow:row nowrap;width:auto;min-width:20px;justify-content:flex-start;align-items:center}.bx--cc--tooltip .content-box .datapoint-tooltip p,.bx--cc--tooltip .content-box .legend-tooltip p,.bx--cc--tooltip .content-box .axis-tooltip p,.bx--cc--tooltip .content-box .total-val p{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:16px;font-size:12px;display:inline-block;margin:0;padding:0;border:0}.bx--cc--tooltip .content-box .datapoint-tooltip p.label,.bx--cc--tooltip .content-box .legend-tooltip p.label,.bx--cc--tooltip .content-box .axis-tooltip p.label,.bx--cc--tooltip .content-box .total-val p.label{flex:1;margin-right:8px}.bx--cc--tooltip .content-box .datapoint-tooltip p.value,.bx--cc--tooltip .content-box .legend-tooltip p.value,.bx--cc--tooltip .content-box .axis-tooltip p.value,.bx--cc--tooltip .content-box .total-val p.value{width:auto}.bx--cc--tooltip .content-box .total-val{font-weight:600}.bx--cc--tooltip .content-box .total-val .label{margin-left:4px}.bx--cc--tooltip .content-box ul.multi-tooltip{margin:0;padding:0}.bx--cc--tooltip .content-box ul.multi-tooltip li{list-style:none;position:relative}.bx--cc--tooltip .content-box ul.multi-tooltip li:not(:last-child){border-bottom:1px solid #565656}.bx--cc--tooltip .tooltip-color{position:absolute;left:0;top:0;width:4px;height:100%}.bx--cc--tooltip .tooltip-color+p.label{margin-left:4px}.bx--cc--threshold line.threshold-line{stroke:#fa4d56;stroke-width:1;stroke-dasharray:4;cursor:pointer;pointer-events:none}.bx--cc--threshold.active line.threshold-line{stroke-width:2}.bx--cc--threshold rect.threshold-hoverable-area{height:20px;transform:translate(0, -10px);cursor:pointer;fill:transparent}.bx--cc--threshold rect.threshold-hoverable-area.rotate{transform:rotate(90deg) translate(0, -10px)}.bx--cc--threshold--label{background-color:#fa4d56;pointer-events:none;transition:opacity .1s;transition-timing-function:cubic-bezier(0.4, 0.14, 0.3, 1);display:inline;box-shadow:0 1px 6px 0 rgba(0,0,0,.2);position:absolute;word-wrap:break-word;z-index:1059;font-family:'IBM Plex Sans Condensed', 'Helvetica Neue', Arial, sans-serif;color:#f3f3f3;line-height:16px;font-size:12px;padding:4px;min-width:20px}.bx--cc--threshold--label.hidden{opacity:0;transition:opacity .1s;transition-timing-function:cubic-bezier(0.4, 0.14, 0.3, 1)}.bx--cc--area path.area,.bx--cc--area-stacked path.area{pointer-events:none}g.bx--cc--bubble circle.dot.hovered{fill-opacity:1;transition:all .1s;transition-timing-function:cubic-bezier(0.4, 0.14, 0.3, 1)}g.bx--cc--bubble circle.dot.unfilled{fill:#3d3d3d}g.bx--cc--bubble g.lines path.line{mix-blend-mode:multiply}.bx--cc--line path.line{pointer-events:none;fill:none;stroke-width:1.5}g.bx--cc--scatter circle.dot.hovered{fill-opacity:1;transition:all .1s;transition-timing-function:cubic-bezier(0.4, 0.14, 0.3, 1)}g.bx--cc--scatter circle.dot.unfilled{fill:#3d3d3d;stroke-width:1.5}g.bx--cc--scatter circle.dot.threshold-anomaly{stroke-width:3}g.bx--cc--scatter g.lines path.line{mix-blend-mode:multiply}.bx--cc--radar .blobs path{stroke-width:1.5px}.bx--cc--radar .y-axes path,.bx--cc--radar .x-axes line{stroke-width:1px;stroke:#565656}.bx--cc--radar .x-axes line.hovered{stroke:#fff}.bx--cc--gauge path.arc-background{fill:#3d3d3d}.bx--cc--gauge .gauge-delta-arrow.status--danger{fill:#fb4b53}.bx--cc--gauge .gauge-delta-arrow.status--warning{fill:#fdd13a}.bx--cc--gauge .gauge-delta-arrow.status--success{fill:#3dbb61}svg.bx--cc--chart-svg{font-family:'IBM Plex Sans Condensed', 'Helvetica Neue', Arial, sans-serif}svg.bx--cc--chart-svg text{font-size:12px;font-weight:400;fill:#bebebe}.bx--chart-holder{position:relative;display:block;width:100%;height:100%;background-color:#282828}svg.bx--cc--chart-svg{overflow:visible}/*# sourceMappingURL=styles-g90.min.css.map */
|
package/styles-g90.min.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["styles/components/_axis.scss","styles/vendor/carbon-components/scss/globals/scss/vendor/@carbon/elements/scss/themes/_mixins.scss","styles/components/_callouts.scss","styles/components/_grid.scss","styles/components/_ruler.scss","styles/vendor/@carbon/colors/scss/mixins.scss","styles/components/_skeleton.scss","styles/components/_zero-line.scss","styles/components/_layout.scss","styles/components/_legend.scss","styles/components/_title.scss","styles/components/_tooltip.scss","styles/vendor/@carbon/motion/scss/motion.scss","styles/components/_threshold.scss","styles/graphs/_area.scss","styles/graphs/_bubble.scss","styles/graphs/_line.scss","styles/graphs/_scatter.scss","styles/graphs/_radar.scss","styles/graphs/_gauge.scss","styles/_type.scss","styles/_chart-holder.scss","styles/styles.scss"],"names":[],"mappings":"AAKC,uCACC,kBAGD,iCACC,KCiCU,QDhCV,2EAGD,iCACC,aAGD,iCACC,OCqBQ,QCxCV,8BACC,OD0CW,QE1CX,uCAME,KF6Be,QE3BhB,OF8BQ,QEzBR,sEACC,oBACA,iBACA,OFsBO,QEnBR,oFACC,qBACA,OF0CO,KG/DT,+BAEE,OC4XiB,KDlXlB,iBACA,mBACA,oBAGD,sCACC,KC4WkB,KD3WlB,yBACA,mBEdD,+CAME,KLuBe,QKnBjB,wCACC,iBACA,2BAGD,qCACC,iBACA,OLeQ,QKXR,kDACC,WLUO,QKPR,+CACC,WD8ViB,KCzVnB,wCACC,yBAGD,qCACC,KAzCe,qBA6Cf,kDACC,WA9Cc,qBAiDf,+CACC,WAjDmB,sBCHtB,+BACC,ONuCS,QOxCV,oCACC,iBCDD,iBACC,iBAGC,6CACC,iBACA,iBAEA,0DACC,ORkCQ,QQjCR,KR0Bc,QQvBf,kEACC,aAIF,iDACC,UACA,OJ2QiB,QI1QjB,eAGD,gDACC,KRWe,QQVf,ORUe,QQPhB,oCACC,eACA,KRYS,QQRX,+CACC,eClCF,0BACC,KTuCW,QStCX,eACA,iEACA,gBCDD,iBACC,iBVgCS,QU/BT,oBACA,uBC4CC,2DD1CD,eACA,sCACA,kBACA,qBACA,aACA,2EAEA,wBACC,UACA,uBCiCA,2DD7BD,8BACC,MVkBU,QUhBV,6CACC,iBACA,eACA,YACA,eAGD,
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["styles/components/_axis.scss","styles/vendor/carbon-components/scss/globals/scss/vendor/@carbon/elements/scss/themes/_mixins.scss","styles/components/_callouts.scss","styles/components/_grid.scss","styles/components/_ruler.scss","styles/vendor/@carbon/colors/scss/mixins.scss","styles/components/_skeleton.scss","styles/components/_zero-line.scss","styles/components/_layout.scss","styles/components/_legend.scss","styles/components/_title.scss","styles/components/_tooltip.scss","styles/vendor/@carbon/motion/scss/motion.scss","styles/components/_threshold.scss","styles/graphs/_area.scss","styles/graphs/_bubble.scss","styles/graphs/_line.scss","styles/graphs/_scatter.scss","styles/graphs/_radar.scss","styles/graphs/_gauge.scss","styles/_type.scss","styles/_chart-holder.scss","styles/styles.scss"],"names":[],"mappings":"AAKC,uCACC,kBAGD,iCACC,KCiCU,QDhCV,2EAGD,iCACC,aAGD,iCACC,OCqBQ,QCxCV,8BACC,OD0CW,QE1CX,uCAME,KF6Be,QE3BhB,OF8BQ,QEzBR,sEACC,oBACA,iBACA,OFsBO,QEnBR,oFACC,qBACA,OF0CO,KG/DT,+BAEE,OC4XiB,KDlXlB,iBACA,mBACA,oBAGD,sCACC,KC4WkB,KD3WlB,yBACA,mBEdD,+CAME,KLuBe,QKnBjB,wCACC,iBACA,2BAGD,qCACC,iBACA,OLeQ,QKXR,kDACC,WLUO,QKPR,+CACC,WD8ViB,KCzVnB,wCACC,yBAGD,qCACC,KAzCe,qBA6Cf,kDACC,WA9Cc,qBAiDf,+CACC,WAjDmB,sBCHtB,+BACC,ONuCS,QOxCV,oCACC,iBCDD,iBACC,iBAGC,6CACC,iBACA,iBAEA,0DACC,ORkCQ,QQjCR,KR0Bc,QQvBf,kEACC,aAIF,iDACC,UACA,OJ2QiB,QI1QjB,eAGD,gDACC,KRWe,QQVf,ORUe,QQPhB,oCACC,eACA,KRYS,QQRX,+CACC,eClCF,0BACC,KTuCW,QStCX,eACA,iEACA,gBCDD,iBACC,iBVgCS,QU/BT,oBACA,uBC4CC,2DD1CD,eACA,sCACA,kBACA,qBACA,aACA,2EAEA,wBACC,UACA,uBCiCA,2DD7BD,8BACC,MVkBU,QUhBV,6CACC,iBACA,eACA,YACA,eAGD,oLAIC,aACA,YACA,qBACA,WACA,eACA,2BACA,mBAEA,4LACC,mBACA,gBACA,uBACA,iBACA,eACA,qBACA,SACA,UACA,SAEA,oNACC,OACA,iBAGD,oNACC,WAKH,yCACC,gBACA,gDACC,gBAIF,+CACC,SACA,UAEA,kDACC,gBACA,kBAEA,mEAME,gCAOL,gCACC,kBACA,OACA,MACA,UACA,YACA,wCACC,gBErGF,uCACC,OR4cS,QQ3cT,eACA,mBACA,eACA,oBAGD,8CACC,eAGD,iDACC,YACA,8BACA,eACA,iBAEA,wDACC,4CAKH,0BACC,iBRobU,QQnbV,oBACA,uBDwBC,2DCtBD,eACA,sCACA,kBACA,qBACA,aACA,2EAEA,MZKW,QYJX,iBACA,eACA,YACA,eAEA,iCACC,UACA,uBDOA,2DEpDF,wDAEC,oBCCA,oCACC,eACA,mBH+CA,2DG3CD,qCACC,Kd2BQ,QcxBT,mCACC,wBCdF,wBACC,oBACA,UACA,sDCCC,eACA,mBL+CA,2DK3CD,sCACC,KhB2BQ,QgB1BR,iBAGD,+CACC,eAGD,oCACC,wBClBD,2BACC,mBAGD,wDAEC,iBACA,OjB+BQ,QiB5BT,oCAEE,ObkXiB,Kc9XnB,mCACC,KlBmCQ,QkB/BR,iDACC,KlBgDY,QkB7Cb,kDACC,KlB8CY,QkB3Cb,kDACC,KlByCY,QmBpDf,sBACC,2EAEA,2BACC,eACA,gBACA,KnBiCU,QoB3CZ,kBACC,kBACA,cACA,WACA,YACA,iBpB+BiB,QqBjBlB,sBACC","file":"styles-g90.min.css"}
|
package/styles.css
CHANGED
|
@@ -146,6 +146,8 @@ g.bx--cc--legend.clickable g.legend-item:hover {
|
|
|
146
146
|
min-width: 20px;
|
|
147
147
|
}
|
|
148
148
|
.bx--cc--tooltip .content-box .datapoint-tooltip,
|
|
149
|
+
.bx--cc--tooltip .content-box .legend-tooltip,
|
|
150
|
+
.bx--cc--tooltip .content-box .axis-tooltip,
|
|
149
151
|
.bx--cc--tooltip .content-box .total-val {
|
|
150
152
|
display: flex;
|
|
151
153
|
padding: 4px;
|
|
@@ -156,6 +158,8 @@ g.bx--cc--legend.clickable g.legend-item:hover {
|
|
|
156
158
|
align-items: center;
|
|
157
159
|
}
|
|
158
160
|
.bx--cc--tooltip .content-box .datapoint-tooltip p,
|
|
161
|
+
.bx--cc--tooltip .content-box .legend-tooltip p,
|
|
162
|
+
.bx--cc--tooltip .content-box .axis-tooltip p,
|
|
159
163
|
.bx--cc--tooltip .content-box .total-val p {
|
|
160
164
|
white-space: nowrap;
|
|
161
165
|
overflow: hidden;
|
|
@@ -168,11 +172,15 @@ g.bx--cc--legend.clickable g.legend-item:hover {
|
|
|
168
172
|
border: 0;
|
|
169
173
|
}
|
|
170
174
|
.bx--cc--tooltip .content-box .datapoint-tooltip p.label,
|
|
175
|
+
.bx--cc--tooltip .content-box .legend-tooltip p.label,
|
|
176
|
+
.bx--cc--tooltip .content-box .axis-tooltip p.label,
|
|
171
177
|
.bx--cc--tooltip .content-box .total-val p.label {
|
|
172
178
|
flex: 1;
|
|
173
179
|
margin-right: 8px;
|
|
174
180
|
}
|
|
175
181
|
.bx--cc--tooltip .content-box .datapoint-tooltip p.value,
|
|
182
|
+
.bx--cc--tooltip .content-box .legend-tooltip p.value,
|
|
183
|
+
.bx--cc--tooltip .content-box .axis-tooltip p.value,
|
|
176
184
|
.bx--cc--tooltip .content-box .total-val p.value {
|
|
177
185
|
width: auto;
|
|
178
186
|
}
|
package/styles.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["styles/components/_axis.scss","styles/vendor/carbon-components/scss/globals/scss/vendor/@carbon/elements/scss/themes/_mixins.scss","styles/components/_callouts.scss","styles/components/_grid.scss","styles/components/_ruler.scss","styles/vendor/@carbon/colors/scss/mixins.scss","styles/components/_skeleton.scss","styles/components/_zero-line.scss","styles/components/_layout.scss","styles/components/_legend.scss","styles/components/_title.scss","styles/components/_tooltip.scss","styles/vendor/@carbon/motion/scss/motion.scss","styles/components/_threshold.scss","styles/graphs/_area.scss","styles/graphs/_bubble.scss","styles/graphs/_line.scss","styles/graphs/_scatter.scss","styles/graphs/_radar.scss","styles/graphs/_gauge.scss","styles/_type.scss","styles/_chart-holder.scss","styles/styles.scss"],"names":[],"mappings":"AAKC;EACC;;AAGD;EACC,MCiCU;EDhCV;;AAGD;EACC;;AAGD;EACC,QCqBQ;;ACxCV;EACC,QD0CW;;;AE1CX;EAME,MF6Be;EE3BhB,QF8BQ;;AEzBR;AAAA;EACC;EACA;EACA,QFsBO;;AEnBR;AAAA;EACC;EACA,QF0CO;;;AG/DT;EASE,QC+QmB;ED5QpB;EACA;EACA;;AAGD;EACC,MC4WkB;ED3WlB;EACA;;;AEdD;EAME,MLuBe;;AKnBjB;EACC;EACA;;AAGD;EACC;EACA,QLeQ;;AKXR;EACC,YLUO;;AKPR;EACC,YD8ViB;;ACzVnB;EACC;;AAGD;EACC,MAzCe;;AA6Cf;EACC,YA9Cc;;AAiDf;EACC,YAjDmB;;;ACHtB;EACC,QNuCS;;;AOxCV;EACC;;;ACDD;EACC;;AAGC;EACC;EACA;;AAEA;EACC,QRkCQ;EQjCR,MR0Bc;;AQvBf;EACC;;AAIF;EACC;EACA,QJ2QiB;EI1QjB;;AAGD;EACC,MRWe;EQVf,QRUe;;AQPhB;EACC;EACA,MRYS;;AQRX;EACC;;;AClCF;EACC,MTuCW;EStCX;EACA;EACA;;;ACDD;EACC,kBVgCS;EU/BT;EACA;EC4CC;ED1CD;EACA;EACA;EACA;EACA;EACA;;AAEA;EACC;EACA;ECiCA;;AD7BD;EACC,OVkBU;;AUhBV;EACC;EACA;EACA;EACA;;AAGD;AAAA;
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["styles/components/_axis.scss","styles/vendor/carbon-components/scss/globals/scss/vendor/@carbon/elements/scss/themes/_mixins.scss","styles/components/_callouts.scss","styles/components/_grid.scss","styles/components/_ruler.scss","styles/vendor/@carbon/colors/scss/mixins.scss","styles/components/_skeleton.scss","styles/components/_zero-line.scss","styles/components/_layout.scss","styles/components/_legend.scss","styles/components/_title.scss","styles/components/_tooltip.scss","styles/vendor/@carbon/motion/scss/motion.scss","styles/components/_threshold.scss","styles/graphs/_area.scss","styles/graphs/_bubble.scss","styles/graphs/_line.scss","styles/graphs/_scatter.scss","styles/graphs/_radar.scss","styles/graphs/_gauge.scss","styles/_type.scss","styles/_chart-holder.scss","styles/styles.scss"],"names":[],"mappings":"AAKC;EACC;;AAGD;EACC,MCiCU;EDhCV;;AAGD;EACC;;AAGD;EACC,QCqBQ;;ACxCV;EACC,QD0CW;;;AE1CX;EAME,MF6Be;EE3BhB,QF8BQ;;AEzBR;AAAA;EACC;EACA;EACA,QFsBO;;AEnBR;AAAA;EACC;EACA,QF0CO;;;AG/DT;EASE,QC+QmB;ED5QpB;EACA;EACA;;AAGD;EACC,MC4WkB;ED3WlB;EACA;;;AEdD;EAME,MLuBe;;AKnBjB;EACC;EACA;;AAGD;EACC;EACA,QLeQ;;AKXR;EACC,YLUO;;AKPR;EACC,YD8ViB;;ACzVnB;EACC;;AAGD;EACC,MAzCe;;AA6Cf;EACC,YA9Cc;;AAiDf;EACC,YAjDmB;;;ACHtB;EACC,QNuCS;;;AOxCV;EACC;;;ACDD;EACC;;AAGC;EACC;EACA;;AAEA;EACC,QRkCQ;EQjCR,MR0Bc;;AQvBf;EACC;;AAIF;EACC;EACA,QJ2QiB;EI1QjB;;AAGD;EACC,MRWe;EQVf,QRUe;;AQPhB;EACC;EACA,MRYS;;AQRX;EACC;;;AClCF;EACC,MTuCW;EStCX;EACA;EACA;;;ACDD;EACC,kBVgCS;EU/BT;EACA;EC4CC;ED1CD;EACA;EACA;EACA;EACA;EACA;;AAEA;EACC;EACA;ECiCA;;AD7BD;EACC,OVkBU;;AUhBV;EACC;EACA;EACA;EACA;;AAGD;AAAA;AAAA;AAAA;EAIC;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;AAAA;AAAA;AAAA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;AAAA;AAAA;AAAA;EACC;EACA;;AAGD;AAAA;AAAA;AAAA;EACC;;AAKH;EACC;;AACA;EACC;;AAIF;EACC;EACA;;AAEA;EACC;EACA;;AAEA;EAME;;AAOL;EACC;EACA;EACA;EACA;EACA;;AACA;EACC;;;AErGF;EACC,QR4cS;EQ3cT;EACA;EACA;EACA;;AAGD;EACC;;AAGD;EACC;EACA;EACA;EACA;;AAEA;EACC;;;AAKH;EACC,kBRobU;EQnbV;EACA;EDwBC;ECtBD;EACA;EACA;EACA;EACA;EACA;EAEA,OZKW;EYJX;EACA;EACA;EACA;;AAEA;EACC;EACA;EDOA;;;AEpDF;AAAA;EAEC;;;ACCA;EACC;EACA;EH+CA;;AG3CD;EACC,Md2BQ;;AcxBT;EACC;;;ACdF;EACC;EACA;EACA;;;ACAA;EACC;EACA;EL+CA;;AK3CD;EACC,MhB2BQ;EgB1BR;;AAGD;EACC;;AAGD;EACC;;;AClBD;EACC;;AAGD;AAAA;EAEC;EACA,QjB+BQ;;AiB5BT;EASE,QbqQmB;;;AcxRrB;EACC,MlBmCQ;;AkB/BR;EACC,MlBgDY;;AkB7Cb;EACC,MlB8CY;;AkB3Cb;EACC,MlByCY;;;AmBpDf;EACC;;AAEA;EACC;EACA;EACA,MnBiCU;;;AoB3CZ;EACC;EACA;EACA;EACA;EACA,kBpB+BiB;;;AqBjBlB;EACC","file":"styles.css"}
|
package/styles.min.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.bx--cc--axes g.axis g.ticks.invisible{visibility:hidden}.bx--cc--axes g.axis g.tick text{fill:#565656;font-family:'IBM Plex Sans Condensed', 'Helvetica Neue', Arial, sans-serif}.bx--cc--axes g.axis g.tick line{display:none}.bx--cc--axes g.axis path.domain{stroke:#8c8c8c}.bx--cc--chart-svg g.callouts{stroke:#565656}.bx--cc--grid rect.chart-grid-backdrop{fill:#fff;stroke:#dcdcdc}.bx--cc--grid g.x.grid g.tick line,.bx--cc--grid g.y.grid g.tick line{pointer-events:none;stroke-width:1px;stroke:#dcdcdc}.bx--cc--grid g.x.grid g.tick.active line,.bx--cc--grid g.y.grid g.tick.active line{stroke-dasharray:2px;stroke:#0062ff}.bx--cc--ruler line.ruler-line{stroke:#000;stroke-width:1px;stroke-dasharray:2;pointer-events:none}.bx--cc--ruler text.axis-tooltip-text{fill:#fff;dominant-baseline:middle;text-anchor:middle}.bx--cc--skeleton rect.chart-skeleton-backdrop{fill:#fff}.bx--cc--skeleton .shimmer-effect-lines{stroke-width:1px;stroke:url(#shimmer-lines)}.bx--cc--skeleton .empty-state-lines{stroke-width:1px;stroke:#dcdcdc}.bx--cc--skeleton #shimmer-lines .stop-bg-shimmer{stop-color:#dcdcdc}.bx--cc--skeleton #shimmer-lines .stop-shimmer{stop-color:#fff}.bx--cc--skeleton .shimmer-effect-areas{fill:url(#shimmer-areas)}.bx--cc--skeleton .empty-state-areas{fill:rgba(127,127,127,.1)}.bx--cc--skeleton #shimmer-areas .stop-bg-shimmer{stop-color:rgba(127,127,127,.1)}.bx--cc--skeleton #shimmer-areas .stop-shimmer{stop-color:rgba(255,255,255,.15)}.bx--cc--zero-line line.domain{stroke:#8c8c8c}.bx--cc--chart-svg svg.layout-child{overflow:visible}g.bx--cc--legend{user-select:none}g.bx--cc--legend g.legend-item rect.checkbox{stroke-width:1px;stroke-opacity:1}g.bx--cc--legend g.legend-item rect.checkbox:not(.active){stroke:#565656;fill:#fff}g.bx--cc--legend g.legend-item rect.checkbox:not(.active)~g.check{display:none}g.bx--cc--legend g.legend-item rect.hover-stroke{fill:none;stroke:#0f62fe;stroke-width:2}g.bx--cc--legend g.legend-item g.check>svg path{fill:#fff;stroke:#fff}g.bx--cc--legend g.legend-item text{font-size:12px;fill:#565656}g.bx--cc--legend.clickable g.legend-item:hover{cursor:pointer}.bx--cc--title text.title{fill:#171717;font-size:16px;font-family:'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;font-weight:600}.bx--cc--tooltip{background-color:#fff;pointer-events:none;transition:opacity .1s;transition-timing-function:cubic-bezier(0.4, 0.14, 0.3, 1);display:inline;box-shadow:0 1px 6px 0 rgba(0,0,0,.2);position:absolute;word-wrap:break-word;z-index:1059;font-family:'IBM Plex Sans Condensed', 'Helvetica Neue', Arial, sans-serif}.bx--cc--tooltip.hidden{opacity:0;transition:opacity .1s;transition-timing-function:cubic-bezier(0.4, 0.14, 0.3, 1)}.bx--cc--tooltip .content-box{color:#171717}.bx--cc--tooltip .content-box .title-tooltip{line-height:16px;font-size:12px;padding:4px;min-width:20px}.bx--cc--tooltip .content-box .datapoint-tooltip,.bx--cc--tooltip .content-box .total-val{display:flex;padding:4px;flex-flow:row nowrap;width:auto;min-width:20px;justify-content:flex-start;align-items:center}.bx--cc--tooltip .content-box .datapoint-tooltip p,.bx--cc--tooltip .content-box .total-val p{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:16px;font-size:12px;display:inline-block;margin:0;padding:0;border:0}.bx--cc--tooltip .content-box .datapoint-tooltip p.label,.bx--cc--tooltip .content-box .total-val p.label{flex:1;margin-right:8px}.bx--cc--tooltip .content-box .datapoint-tooltip p.value,.bx--cc--tooltip .content-box .total-val p.value{width:auto}.bx--cc--tooltip .content-box .total-val{font-weight:600}.bx--cc--tooltip .content-box .total-val .label{margin-left:4px}.bx--cc--tooltip .content-box ul.multi-tooltip{margin:0;padding:0}.bx--cc--tooltip .content-box ul.multi-tooltip li{list-style:none;position:relative}.bx--cc--tooltip .content-box ul.multi-tooltip li:not(:last-child){border-bottom:1px solid #dcdcdc}.bx--cc--tooltip .tooltip-color{position:absolute;left:0;top:0;width:4px;height:100%}.bx--cc--tooltip .tooltip-color+p.label{margin-left:4px}.bx--cc--threshold line.threshold-line{stroke:#fa4d56;stroke-width:1;stroke-dasharray:4;cursor:pointer;pointer-events:none}.bx--cc--threshold.active line.threshold-line{stroke-width:2}.bx--cc--threshold rect.threshold-hoverable-area{height:20px;transform:translate(0, -10px);cursor:pointer;fill:transparent}.bx--cc--threshold rect.threshold-hoverable-area.rotate{transform:rotate(90deg) translate(0, -10px)}.bx--cc--threshold--label{background-color:#fa4d56;pointer-events:none;transition:opacity .1s;transition-timing-function:cubic-bezier(0.4, 0.14, 0.3, 1);display:inline;box-shadow:0 1px 6px 0 rgba(0,0,0,.2);position:absolute;word-wrap:break-word;z-index:1059;font-family:'IBM Plex Sans Condensed', 'Helvetica Neue', Arial, sans-serif;color:#171717;line-height:16px;font-size:12px;padding:4px;min-width:20px}.bx--cc--threshold--label.hidden{opacity:0;transition:opacity .1s;transition-timing-function:cubic-bezier(0.4, 0.14, 0.3, 1)}.bx--cc--area path.area,.bx--cc--area-stacked path.area{pointer-events:none}g.bx--cc--bubble circle.dot.hovered{fill-opacity:1;transition:all .1s;transition-timing-function:cubic-bezier(0.4, 0.14, 0.3, 1)}g.bx--cc--bubble circle.dot.unfilled{fill:#f3f3f3}g.bx--cc--bubble g.lines path.line{mix-blend-mode:multiply}.bx--cc--line path.line{pointer-events:none;fill:none;stroke-width:1.5}g.bx--cc--scatter circle.dot.hovered{fill-opacity:1;transition:all .1s;transition-timing-function:cubic-bezier(0.4, 0.14, 0.3, 1)}g.bx--cc--scatter circle.dot.unfilled{fill:#f3f3f3;stroke-width:1.5}g.bx--cc--scatter circle.dot.threshold-anomaly{stroke-width:3}g.bx--cc--scatter g.lines path.line{mix-blend-mode:multiply}.bx--cc--radar .blobs path{stroke-width:1.5px}.bx--cc--radar .y-axes path,.bx--cc--radar .x-axes line{stroke-width:1px;stroke:#dcdcdc}.bx--cc--radar .x-axes line.hovered{stroke:#000}.bx--cc--gauge path.arc-background{fill:#f3f3f3}.bx--cc--gauge .gauge-delta-arrow.status--danger{fill:#da1e28}.bx--cc--gauge .gauge-delta-arrow.status--warning{fill:#fdd13a}.bx--cc--gauge .gauge-delta-arrow.status--success{fill:#24a148}svg.bx--cc--chart-svg{font-family:'IBM Plex Sans Condensed', 'Helvetica Neue', Arial, sans-serif}svg.bx--cc--chart-svg text{font-size:12px;font-weight:400;fill:#565656}.bx--chart-holder{position:relative;display:block;width:100%;height:100%;background-color:#fff}svg.bx--cc--chart-svg{overflow:visible}/*# sourceMappingURL=styles.min.css.map */
|
|
1
|
+
.bx--cc--axes g.axis g.ticks.invisible{visibility:hidden}.bx--cc--axes g.axis g.tick text{fill:#565656;font-family:'IBM Plex Sans Condensed', 'Helvetica Neue', Arial, sans-serif}.bx--cc--axes g.axis g.tick line{display:none}.bx--cc--axes g.axis path.domain{stroke:#8c8c8c}.bx--cc--chart-svg g.callouts{stroke:#565656}.bx--cc--grid rect.chart-grid-backdrop{fill:#fff;stroke:#dcdcdc}.bx--cc--grid g.x.grid g.tick line,.bx--cc--grid g.y.grid g.tick line{pointer-events:none;stroke-width:1px;stroke:#dcdcdc}.bx--cc--grid g.x.grid g.tick.active line,.bx--cc--grid g.y.grid g.tick.active line{stroke-dasharray:2px;stroke:#0062ff}.bx--cc--ruler line.ruler-line{stroke:#000;stroke-width:1px;stroke-dasharray:2;pointer-events:none}.bx--cc--ruler text.axis-tooltip-text{fill:#fff;dominant-baseline:middle;text-anchor:middle}.bx--cc--skeleton rect.chart-skeleton-backdrop{fill:#fff}.bx--cc--skeleton .shimmer-effect-lines{stroke-width:1px;stroke:url(#shimmer-lines)}.bx--cc--skeleton .empty-state-lines{stroke-width:1px;stroke:#dcdcdc}.bx--cc--skeleton #shimmer-lines .stop-bg-shimmer{stop-color:#dcdcdc}.bx--cc--skeleton #shimmer-lines .stop-shimmer{stop-color:#fff}.bx--cc--skeleton .shimmer-effect-areas{fill:url(#shimmer-areas)}.bx--cc--skeleton .empty-state-areas{fill:rgba(127,127,127,.1)}.bx--cc--skeleton #shimmer-areas .stop-bg-shimmer{stop-color:rgba(127,127,127,.1)}.bx--cc--skeleton #shimmer-areas .stop-shimmer{stop-color:rgba(255,255,255,.15)}.bx--cc--zero-line line.domain{stroke:#8c8c8c}.bx--cc--chart-svg svg.layout-child{overflow:visible}g.bx--cc--legend{user-select:none}g.bx--cc--legend g.legend-item rect.checkbox{stroke-width:1px;stroke-opacity:1}g.bx--cc--legend g.legend-item rect.checkbox:not(.active){stroke:#565656;fill:#fff}g.bx--cc--legend g.legend-item rect.checkbox:not(.active)~g.check{display:none}g.bx--cc--legend g.legend-item rect.hover-stroke{fill:none;stroke:#0f62fe;stroke-width:2}g.bx--cc--legend g.legend-item g.check>svg path{fill:#fff;stroke:#fff}g.bx--cc--legend g.legend-item text{font-size:12px;fill:#565656}g.bx--cc--legend.clickable g.legend-item:hover{cursor:pointer}.bx--cc--title text.title{fill:#171717;font-size:16px;font-family:'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;font-weight:600}.bx--cc--tooltip{background-color:#fff;pointer-events:none;transition:opacity .1s;transition-timing-function:cubic-bezier(0.4, 0.14, 0.3, 1);display:inline;box-shadow:0 1px 6px 0 rgba(0,0,0,.2);position:absolute;word-wrap:break-word;z-index:1059;font-family:'IBM Plex Sans Condensed', 'Helvetica Neue', Arial, sans-serif}.bx--cc--tooltip.hidden{opacity:0;transition:opacity .1s;transition-timing-function:cubic-bezier(0.4, 0.14, 0.3, 1)}.bx--cc--tooltip .content-box{color:#171717}.bx--cc--tooltip .content-box .title-tooltip{line-height:16px;font-size:12px;padding:4px;min-width:20px}.bx--cc--tooltip .content-box .datapoint-tooltip,.bx--cc--tooltip .content-box .legend-tooltip,.bx--cc--tooltip .content-box .axis-tooltip,.bx--cc--tooltip .content-box .total-val{display:flex;padding:4px;flex-flow:row nowrap;width:auto;min-width:20px;justify-content:flex-start;align-items:center}.bx--cc--tooltip .content-box .datapoint-tooltip p,.bx--cc--tooltip .content-box .legend-tooltip p,.bx--cc--tooltip .content-box .axis-tooltip p,.bx--cc--tooltip .content-box .total-val p{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:16px;font-size:12px;display:inline-block;margin:0;padding:0;border:0}.bx--cc--tooltip .content-box .datapoint-tooltip p.label,.bx--cc--tooltip .content-box .legend-tooltip p.label,.bx--cc--tooltip .content-box .axis-tooltip p.label,.bx--cc--tooltip .content-box .total-val p.label{flex:1;margin-right:8px}.bx--cc--tooltip .content-box .datapoint-tooltip p.value,.bx--cc--tooltip .content-box .legend-tooltip p.value,.bx--cc--tooltip .content-box .axis-tooltip p.value,.bx--cc--tooltip .content-box .total-val p.value{width:auto}.bx--cc--tooltip .content-box .total-val{font-weight:600}.bx--cc--tooltip .content-box .total-val .label{margin-left:4px}.bx--cc--tooltip .content-box ul.multi-tooltip{margin:0;padding:0}.bx--cc--tooltip .content-box ul.multi-tooltip li{list-style:none;position:relative}.bx--cc--tooltip .content-box ul.multi-tooltip li:not(:last-child){border-bottom:1px solid #dcdcdc}.bx--cc--tooltip .tooltip-color{position:absolute;left:0;top:0;width:4px;height:100%}.bx--cc--tooltip .tooltip-color+p.label{margin-left:4px}.bx--cc--threshold line.threshold-line{stroke:#fa4d56;stroke-width:1;stroke-dasharray:4;cursor:pointer;pointer-events:none}.bx--cc--threshold.active line.threshold-line{stroke-width:2}.bx--cc--threshold rect.threshold-hoverable-area{height:20px;transform:translate(0, -10px);cursor:pointer;fill:transparent}.bx--cc--threshold rect.threshold-hoverable-area.rotate{transform:rotate(90deg) translate(0, -10px)}.bx--cc--threshold--label{background-color:#fa4d56;pointer-events:none;transition:opacity .1s;transition-timing-function:cubic-bezier(0.4, 0.14, 0.3, 1);display:inline;box-shadow:0 1px 6px 0 rgba(0,0,0,.2);position:absolute;word-wrap:break-word;z-index:1059;font-family:'IBM Plex Sans Condensed', 'Helvetica Neue', Arial, sans-serif;color:#171717;line-height:16px;font-size:12px;padding:4px;min-width:20px}.bx--cc--threshold--label.hidden{opacity:0;transition:opacity .1s;transition-timing-function:cubic-bezier(0.4, 0.14, 0.3, 1)}.bx--cc--area path.area,.bx--cc--area-stacked path.area{pointer-events:none}g.bx--cc--bubble circle.dot.hovered{fill-opacity:1;transition:all .1s;transition-timing-function:cubic-bezier(0.4, 0.14, 0.3, 1)}g.bx--cc--bubble circle.dot.unfilled{fill:#f3f3f3}g.bx--cc--bubble g.lines path.line{mix-blend-mode:multiply}.bx--cc--line path.line{pointer-events:none;fill:none;stroke-width:1.5}g.bx--cc--scatter circle.dot.hovered{fill-opacity:1;transition:all .1s;transition-timing-function:cubic-bezier(0.4, 0.14, 0.3, 1)}g.bx--cc--scatter circle.dot.unfilled{fill:#f3f3f3;stroke-width:1.5}g.bx--cc--scatter circle.dot.threshold-anomaly{stroke-width:3}g.bx--cc--scatter g.lines path.line{mix-blend-mode:multiply}.bx--cc--radar .blobs path{stroke-width:1.5px}.bx--cc--radar .y-axes path,.bx--cc--radar .x-axes line{stroke-width:1px;stroke:#dcdcdc}.bx--cc--radar .x-axes line.hovered{stroke:#000}.bx--cc--gauge path.arc-background{fill:#f3f3f3}.bx--cc--gauge .gauge-delta-arrow.status--danger{fill:#da1e28}.bx--cc--gauge .gauge-delta-arrow.status--warning{fill:#fdd13a}.bx--cc--gauge .gauge-delta-arrow.status--success{fill:#24a148}svg.bx--cc--chart-svg{font-family:'IBM Plex Sans Condensed', 'Helvetica Neue', Arial, sans-serif}svg.bx--cc--chart-svg text{font-size:12px;font-weight:400;fill:#565656}.bx--chart-holder{position:relative;display:block;width:100%;height:100%;background-color:#fff}svg.bx--cc--chart-svg{overflow:visible}/*# sourceMappingURL=styles.min.css.map */
|
package/styles.min.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["styles/components/_axis.scss","styles/vendor/carbon-components/scss/globals/scss/vendor/@carbon/elements/scss/themes/_mixins.scss","styles/components/_callouts.scss","styles/components/_grid.scss","styles/components/_ruler.scss","styles/vendor/@carbon/colors/scss/mixins.scss","styles/components/_skeleton.scss","styles/components/_zero-line.scss","styles/components/_layout.scss","styles/components/_legend.scss","styles/components/_title.scss","styles/components/_tooltip.scss","styles/vendor/@carbon/motion/scss/motion.scss","styles/components/_threshold.scss","styles/graphs/_area.scss","styles/graphs/_bubble.scss","styles/graphs/_line.scss","styles/graphs/_scatter.scss","styles/graphs/_radar.scss","styles/graphs/_gauge.scss","styles/_type.scss","styles/_chart-holder.scss","styles/styles.scss"],"names":[],"mappings":"AAKC,uCACC,kBAGD,iCACC,KCiCU,QDhCV,2EAGD,iCACC,aAGD,iCACC,OCqBQ,QCxCV,8BACC,OD0CW,QE1CX,uCAME,KF6Be,KE3BhB,OF8BQ,QEzBR,sEACC,oBACA,iBACA,OFsBO,QEnBR,oFACC,qBACA,OF0CO,QG/DT,+BASE,OC+QmB,KD5QpB,iBACA,mBACA,oBAGD,sCACC,KC4WkB,KD3WlB,yBACA,mBEdD,+CAME,KLuBe,KKnBjB,wCACC,iBACA,2BAGD,qCACC,iBACA,OLeQ,QKXR,kDACC,WLUO,QKPR,+CACC,WD8ViB,KCzVnB,wCACC,yBAGD,qCACC,KAzCe,qBA6Cf,kDACC,WA9Cc,qBAiDf,+CACC,WAjDmB,sBCHtB,+BACC,ONuCS,QOxCV,oCACC,iBCDD,iBACC,iBAGC,6CACC,iBACA,iBAEA,0DACC,ORkCQ,QQjCR,KR0Bc,KQvBf,kEACC,aAIF,iDACC,UACA,OJ2QiB,QI1QjB,eAGD,gDACC,KRWe,KQVf,ORUe,KQPhB,oCACC,eACA,KRYS,QQRX,+CACC,eClCF,0BACC,KTuCW,QStCX,eACA,iEACA,gBCDD,iBACC,iBVgCS,KU/BT,oBACA,uBC4CC,2DD1CD,eACA,sCACA,kBACA,qBACA,aACA,2EAEA,wBACC,UACA,uBCiCA,2DD7BD,8BACC,MVkBU,QUhBV,6CACC,iBACA,eACA,YACA,eAGD,
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["styles/components/_axis.scss","styles/vendor/carbon-components/scss/globals/scss/vendor/@carbon/elements/scss/themes/_mixins.scss","styles/components/_callouts.scss","styles/components/_grid.scss","styles/components/_ruler.scss","styles/vendor/@carbon/colors/scss/mixins.scss","styles/components/_skeleton.scss","styles/components/_zero-line.scss","styles/components/_layout.scss","styles/components/_legend.scss","styles/components/_title.scss","styles/components/_tooltip.scss","styles/vendor/@carbon/motion/scss/motion.scss","styles/components/_threshold.scss","styles/graphs/_area.scss","styles/graphs/_bubble.scss","styles/graphs/_line.scss","styles/graphs/_scatter.scss","styles/graphs/_radar.scss","styles/graphs/_gauge.scss","styles/_type.scss","styles/_chart-holder.scss","styles/styles.scss"],"names":[],"mappings":"AAKC,uCACC,kBAGD,iCACC,KCiCU,QDhCV,2EAGD,iCACC,aAGD,iCACC,OCqBQ,QCxCV,8BACC,OD0CW,QE1CX,uCAME,KF6Be,KE3BhB,OF8BQ,QEzBR,sEACC,oBACA,iBACA,OFsBO,QEnBR,oFACC,qBACA,OF0CO,QG/DT,+BASE,OC+QmB,KD5QpB,iBACA,mBACA,oBAGD,sCACC,KC4WkB,KD3WlB,yBACA,mBEdD,+CAME,KLuBe,KKnBjB,wCACC,iBACA,2BAGD,qCACC,iBACA,OLeQ,QKXR,kDACC,WLUO,QKPR,+CACC,WD8ViB,KCzVnB,wCACC,yBAGD,qCACC,KAzCe,qBA6Cf,kDACC,WA9Cc,qBAiDf,+CACC,WAjDmB,sBCHtB,+BACC,ONuCS,QOxCV,oCACC,iBCDD,iBACC,iBAGC,6CACC,iBACA,iBAEA,0DACC,ORkCQ,QQjCR,KR0Bc,KQvBf,kEACC,aAIF,iDACC,UACA,OJ2QiB,QI1QjB,eAGD,gDACC,KRWe,KQVf,ORUe,KQPhB,oCACC,eACA,KRYS,QQRX,+CACC,eClCF,0BACC,KTuCW,QStCX,eACA,iEACA,gBCDD,iBACC,iBVgCS,KU/BT,oBACA,uBC4CC,2DD1CD,eACA,sCACA,kBACA,qBACA,aACA,2EAEA,wBACC,UACA,uBCiCA,2DD7BD,8BACC,MVkBU,QUhBV,6CACC,iBACA,eACA,YACA,eAGD,oLAIC,aACA,YACA,qBACA,WACA,eACA,2BACA,mBAEA,4LACC,mBACA,gBACA,uBACA,iBACA,eACA,qBACA,SACA,UACA,SAEA,oNACC,OACA,iBAGD,oNACC,WAKH,yCACC,gBACA,gDACC,gBAIF,+CACC,SACA,UAEA,kDACC,gBACA,kBAEA,mEAME,gCAOL,gCACC,kBACA,OACA,MACA,UACA,YACA,wCACC,gBErGF,uCACC,OR4cS,QQ3cT,eACA,mBACA,eACA,oBAGD,8CACC,eAGD,iDACC,YACA,8BACA,eACA,iBAEA,wDACC,4CAKH,0BACC,iBRobU,QQnbV,oBACA,uBDwBC,2DCtBD,eACA,sCACA,kBACA,qBACA,aACA,2EAEA,MZKW,QYJX,iBACA,eACA,YACA,eAEA,iCACC,UACA,uBDOA,2DEpDF,wDAEC,oBCCA,oCACC,eACA,mBH+CA,2DG3CD,qCACC,Kd2BQ,QcxBT,mCACC,wBCdF,wBACC,oBACA,UACA,sDCCC,eACA,mBL+CA,2DK3CD,sCACC,KhB2BQ,QgB1BR,iBAGD,+CACC,eAGD,oCACC,wBClBD,2BACC,mBAGD,wDAEC,iBACA,OjB+BQ,QiB5BT,oCASE,ObqQmB,KcxRrB,mCACC,KlBmCQ,QkB/BR,iDACC,KlBgDY,QkB7Cb,kDACC,KlB8CY,QkB3Cb,kDACC,KlByCY,QmBpDf,sBACC,2EAEA,2BACC,eACA,gBACA,KnBiCU,QoB3CZ,kBACC,kBACA,cACA,WACA,YACA,iBpB+BiB,KqBjBlB,sBACC","file":"styles.min.css"}
|
package/tools.d.ts
CHANGED
|
@@ -82,6 +82,15 @@ export declare namespace Tools {
|
|
|
82
82
|
* @returns The percentage in the form of a number (1 significant digit if necessary)
|
|
83
83
|
*/
|
|
84
84
|
export function convertValueToPercentage(item: any, fullData: any): number;
|
|
85
|
+
/**
|
|
86
|
+
* Truncate the labels
|
|
87
|
+
* @export
|
|
88
|
+
* @param {any} fullText
|
|
89
|
+
* @param {any} truncationType
|
|
90
|
+
* @param {any} numCharacter
|
|
91
|
+
* @returns Truncated text
|
|
92
|
+
*/
|
|
93
|
+
export function truncateLabel(fullText: any, truncationType: any, numCharacter: any): any;
|
|
85
94
|
/**************************************
|
|
86
95
|
* Object/array related checks *
|
|
87
96
|
*************************************/
|
package/tools.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Internal imports
|
|
2
|
-
import { CartesianOrientations, ScaleTypes, } from "./interfaces";
|
|
3
|
-
import { debounce as lodashDebounce, merge as lodashMerge, cloneDeep as lodashCloneDeep, uniq as lodashUnique, clamp as lodashClamp, isEqual as lodashIsEqual, flatMapDeep as lodashFlatMapDeep, kebabCase as lodashKebabCase, fromPairs as lodashFromPairs, some as lodashSome
|
|
2
|
+
import { CartesianOrientations, ScaleTypes, TruncationTypes } from "./interfaces";
|
|
3
|
+
import { debounce as lodashDebounce, merge as lodashMerge, cloneDeep as lodashCloneDeep, uniq as lodashUnique, clamp as lodashClamp, isEqual as lodashIsEqual, flatMapDeep as lodashFlatMapDeep, kebabCase as lodashKebabCase, fromPairs as lodashFromPairs, some as lodashSome } from "lodash-es";
|
|
4
4
|
// Functions
|
|
5
5
|
export var Tools;
|
|
6
6
|
(function (Tools) {
|
|
@@ -74,7 +74,7 @@ export var Tools;
|
|
|
74
74
|
function getDimensions(el) {
|
|
75
75
|
return {
|
|
76
76
|
width: parseFloat(el.style.width.replace("px", "") || el.offsetWidth),
|
|
77
|
-
height: parseFloat(el.style.height.replace("px", "") || el.offsetHeight)
|
|
77
|
+
height: parseFloat(el.style.height.replace("px", "") || el.offsetHeight)
|
|
78
78
|
};
|
|
79
79
|
}
|
|
80
80
|
Tools.getDimensions = getDimensions;
|
|
@@ -104,7 +104,7 @@ export var Tools;
|
|
|
104
104
|
.split(",");
|
|
105
105
|
return {
|
|
106
106
|
tx: transforms[0],
|
|
107
|
-
ty: transforms[1]
|
|
107
|
+
ty: transforms[1]
|
|
108
108
|
};
|
|
109
109
|
}
|
|
110
110
|
return null;
|
|
@@ -126,7 +126,7 @@ export var Tools;
|
|
|
126
126
|
var xyString = match.split(",");
|
|
127
127
|
return {
|
|
128
128
|
x: parseFloat(xyString[0]),
|
|
129
|
-
y: parseFloat(xyString[1])
|
|
129
|
+
y: parseFloat(xyString[1])
|
|
130
130
|
};
|
|
131
131
|
}
|
|
132
132
|
Tools.getTranformOffsets = getTranformOffsets;
|
|
@@ -172,6 +172,31 @@ export var Tools;
|
|
|
172
172
|
: percentage;
|
|
173
173
|
}
|
|
174
174
|
Tools.convertValueToPercentage = convertValueToPercentage;
|
|
175
|
+
/**
|
|
176
|
+
* Truncate the labels
|
|
177
|
+
* @export
|
|
178
|
+
* @param {any} fullText
|
|
179
|
+
* @param {any} truncationType
|
|
180
|
+
* @param {any} numCharacter
|
|
181
|
+
* @returns Truncated text
|
|
182
|
+
*/
|
|
183
|
+
function truncateLabel(fullText, truncationType, numCharacter) {
|
|
184
|
+
if (numCharacter > fullText.length) {
|
|
185
|
+
return fullText;
|
|
186
|
+
}
|
|
187
|
+
if (truncationType === TruncationTypes.MID_LINE) {
|
|
188
|
+
return (fullText.substr(0, numCharacter / 2) +
|
|
189
|
+
"..." +
|
|
190
|
+
fullText.substr(-numCharacter / 2));
|
|
191
|
+
}
|
|
192
|
+
else if (truncationType === TruncationTypes.FRONT_LINE) {
|
|
193
|
+
return "..." + fullText.substr(-numCharacter);
|
|
194
|
+
}
|
|
195
|
+
else if (truncationType === TruncationTypes.END_LINE) {
|
|
196
|
+
return fullText.substr(0, numCharacter) + "...";
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
Tools.truncateLabel = truncateLabel;
|
|
175
200
|
/**************************************
|
|
176
201
|
* Object/array related checks *
|
|
177
202
|
*************************************/
|
|
@@ -187,7 +212,7 @@ export var Tools;
|
|
|
187
212
|
function arrayDifferences(oldArray, newArray) {
|
|
188
213
|
var difference = {
|
|
189
214
|
missing: [],
|
|
190
|
-
added: []
|
|
215
|
+
added: []
|
|
191
216
|
};
|
|
192
217
|
oldArray.forEach(function (element) {
|
|
193
218
|
if (newArray.indexOf(element) === -1) {
|
|
@@ -274,7 +299,7 @@ export var Tools;
|
|
|
274
299
|
y0: verticalCoordinates.x0,
|
|
275
300
|
y1: verticalCoordinates.x1,
|
|
276
301
|
x0: verticalCoordinates.y0,
|
|
277
|
-
x1: verticalCoordinates.y1
|
|
302
|
+
x1: verticalCoordinates.y1
|
|
278
303
|
};
|
|
279
304
|
}
|
|
280
305
|
return verticalCoordinates;
|
package/tools.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.js","sourceRoot":"","sources":["tools.ts"],"names":[],"mappings":"AAAA,mBAAmB;AACnB,OAAO,EAEN,qBAAqB,EACrB,UAAU,GACV,MAAM,cAAc,CAAC;AAEtB,OAAO,EACN,QAAQ,IAAI,cAAc,EAC1B,KAAK,IAAI,WAAW,EACpB,SAAS,IAAI,eAAe,EAC5B,IAAI,IAAI,YAAY,EACpB,KAAK,IAAI,WAAW,EACpB,OAAO,IAAI,aAAa,EACxB,WAAW,IAAI,iBAAiB,EAChC,SAAS,IAAI,eAAe,EAC5B,SAAS,IAAI,eAAe,EAC5B,IAAI,IAAI,UAAU,GAIlB,MAAM,WAAW,CAAC;AAGnB,YAAY;AACZ,MAAM,KAAW,KAAK,CAwVrB;AAxVD,WAAiB,KAAK;IACrB,qCAAqC;IACxB,cAAQ,GAAG,cAAc,CAAC;IAC1B,WAAK,GAAG,eAAe,CAAC;IACxB,WAAK,GAAG,WAAW,CAAC;IACpB,2BAAqB,GAAG,YAAY,CAAC;IACrC,WAAK,GAAG,WAAW,CAAC;IACpB,aAAO,GAAG,aAAa,CAAC;IACxB,iBAAW,GAAG,iBAAiB,CAAC;IAChC,eAAS,GAAG,eAAe,CAAC;IAC5B,eAAS,GAAG,eAAe,CAAC;IAC5B,UAAI,GAAG,UAAU,CAAC;IAE/B;;;;;;;;;OASG;IACH,SAAgB,wBAAwB,CACvC,cAAmB,EACnB,eAAoB;QAEpB,cAAc,GAAG,KAAK,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;QAC7C,IAAM,iBAAiB,GAAG,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;QAElE,IAAI,iBAAiB,CAAC,MAAM,KAAK,CAAC,EAAE;YACnC,OAAO,cAAc,CAAC,IAAI,CAAC;SAC3B;QAED,iEAAiE;QACj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T,KAAQ,EACR,WAAmC;QAEnC,OAAO,WAAW,KAAK,qBAAqB,CAAC,QAAQ;YACpD,CAAC,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC;YACjB,CAAC,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACpB,CAAC;IARe,0CAAoC,uCAQnD,CAAA;IAEY,oBAAc,GAAG,UAAC,CAAU,EAAE,CAAU;QACpD,OAAA,MAAM,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC;IAAvB,CAAuB,CAAC;AAC1B,CAAC,EAxVgB,KAAK,KAAL,KAAK,QAwVrB","sourcesContent":["// Internal imports\nimport {\n\tAxisChartOptions,\n\tCartesianOrientations,\n\tScaleTypes,\n} from \"./interfaces\";\n\nimport {\n\tdebounce as lodashDebounce,\n\tmerge as lodashMerge,\n\tcloneDeep as lodashCloneDeep,\n\tuniq as lodashUnique,\n\tclamp as lodashClamp,\n\tisEqual as lodashIsEqual,\n\tflatMapDeep as lodashFlatMapDeep,\n\tkebabCase as lodashKebabCase,\n\tfromPairs as lodashFromPairs,\n\tsome as lodashSome,\n\t// the imports below are needed because of typescript bug (error TS4029)\n\tCancelable,\n\tDebounceSettings,\n} from \"lodash-es\";\nimport { Numeric } from \"d3\";\n\n// Functions\nexport namespace Tools {\n\t// Export these functions from lodash\n\texport const debounce = lodashDebounce;\n\texport const clone = lodashCloneDeep;\n\texport const merge = lodashMerge;\n\texport const removeArrayDuplicates = lodashUnique;\n\texport const clamp = lodashClamp;\n\texport const isEqual = lodashIsEqual;\n\texport const flatMapDeep = lodashFlatMapDeep;\n\texport const kebabCase = lodashKebabCase;\n\texport const fromPairs = lodashFromPairs;\n\texport const some = lodashSome;\n\n\t/**\n\t * Returns default chart options merged with provided options,\n\t * with special cases for axes.\n\t * Axes object will not merge the not provided axes.\n\t *\n\t * @export\n\t * @param {AxisChartOptions} defaultOptions Configuration.options[chartType]\n\t * @param {AxisChartOptions} providedOptions user provided options\n\t * @returns merged options\n\t */\n\texport function mergeDefaultChartOptions(\n\t\tdefaultOptions: any,\n\t\tprovidedOptions: any\n\t) {\n\t\tdefaultOptions = Tools.clone(defaultOptions);\n\t\tconst providedAxesNames = Object.keys(providedOptions.axes || {});\n\n\t\tif (providedAxesNames.length === 0) {\n\t\t\tdelete defaultOptions.axes;\n\t\t}\n\n\t\t// Update deprecated options to work with the tabular data format\n\t\t// Similar to the functionality in model.transformToTabularData()\n\t\tfor (const axisName in defaultOptions.axes) {\n\t\t\tif (providedAxesNames.includes(axisName)) {\n\t\t\t\tconst providedAxisOptions = providedOptions.axes[axisName];\n\n\t\t\t\tif (\n\t\t\t\t\tprovidedAxisOptions[\"primary\"] ||\n\t\t\t\t\tprovidedAxisOptions[\"secondary\"]\n\t\t\t\t) {\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t\"`primary` & `secondary` are no longer needed for axis configurations. Read more here https://carbon-design-system.github.io/carbon-charts/?path=/story/tutorials--tabular-data-format\"\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst identifier = providedAxisOptions[\"mapsTo\"];\n\t\t\t\tif (identifier === undefined || identifier === null) {\n\t\t\t\t\tconst scaleType = providedAxisOptions[\"scaleType\"];\n\n\t\t\t\t\tif (scaleType === undefined || scaleType === null) {\n\t\t\t\t\t\tprovidedAxisOptions[\"mapsTo\"] = \"value\";\n\t\t\t\t\t} else if (scaleType === ScaleTypes.TIME) {\n\t\t\t\t\t\tprovidedAxisOptions[\"mapsTo\"] = \"date\";\n\t\t\t\t\t} else if (scaleType === ScaleTypes.LABELS) {\n\t\t\t\t\t\tprovidedAxisOptions[\"mapsTo\"] = \"key\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdelete defaultOptions.axes[axisName];\n\t\t\t}\n\t\t}\n\n\t\treturn Tools.merge(defaultOptions, providedOptions);\n\t}\n\n\t/**************************************\n\t * DOM-related operations *\n\t *************************************/\n\n\t/**\n\t * Get width & height of an element\n\t *\n\t * @export\n\t * @param {any} el element to get dimensions from\n\t * @returns an object containing the width and height of el\n\t */\n\texport function getDimensions(el) {\n\t\treturn {\n\t\t\twidth: parseFloat(\n\t\t\t\tel.style.width.replace(\"px\", \"\") || el.offsetWidth\n\t\t\t),\n\t\t\theight: parseFloat(\n\t\t\t\tel.style.height.replace(\"px\", \"\") || el.offsetHeight\n\t\t\t),\n\t\t};\n\t}\n\n\t/**\n\t * Gets elements's x and y translations from transform attribute or returns null\n\t *\n\t * @param {HTMLElement} element\n\t * @returns an object containing the translated x and y values or null\n\t */\n\texport function getTranslationValues(elementRef: HTMLElement) {\n\t\tif (!elementRef) {\n\t\t\treturn;\n\t\t}\n\n\t\t// regex to ONLY get values for translate (instead of all rotate, translate, skew, etc)\n\t\tconst translateRegex = /translate\\([0-9]+\\.?[0-9]*,[0-9]+\\.?[0-9]*\\)/;\n\n\t\tconst transformStr = elementRef\n\t\t\t.getAttribute(\"transform\")\n\t\t\t.match(translateRegex);\n\t\tif (!transformStr) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// check for the match\n\t\tif (transformStr[0]) {\n\t\t\tconst transforms = transformStr[0]\n\t\t\t\t.replace(/translate\\(/, \"\")\n\t\t\t\t.replace(/\\)/, \"\")\n\t\t\t\t.split(\",\");\n\n\t\t\treturn {\n\t\t\t\ttx: transforms[0],\n\t\t\t\tty: transforms[1],\n\t\t\t};\n\t\t}\n\t\treturn null;\n\t}\n\n\t/**************************************\n\t * Formatting & calculations *\n\t *************************************/\n\n\t/**\n\t * Gets x and y coordinates from HTML transform attribute\n\t *\n\t * @export\n\t * @param {any} string the transform attribute string ie. transform(x,y)\n\t * @returns Returns an object with x and y offsets of the transform\n\t */\n\texport function getTranformOffsets(string) {\n\t\tconst regExp = /\\(([^)]+)\\)/;\n\t\tconst match = regExp.exec(string)[1];\n\t\tconst xyString = match.split(\",\");\n\n\t\treturn {\n\t\t\tx: parseFloat(xyString[0]),\n\t\t\ty: parseFloat(xyString[1]),\n\t\t};\n\t}\n\n\t/**\n\t * Returns string value for height/width using pixels if there isn't a specified unit of measure\n\t *\n\t * @param value string or number value to be checked for unit of measure\n\t */\n\texport function formatWidthHeightValues(value) {\n\t\tconst stringValue = value.toString();\n\n\t\t// If the value provided contains any letters\n\t\t// Return it the same way\n\t\tif (stringValue.match(/[a-z]/i)) {\n\t\t\treturn stringValue;\n\t\t}\n\n\t\treturn stringValue + \"px\";\n\t}\n\n\t/**\n\t * Capitalizes first letter of a string\n\t *\n\t * @export\n\t * @param {any} string the input string to perform first letter capitalization with\n\t * @returns The transformed string after first letter is capitalized\n\t */\n\texport function capitalizeFirstLetter(string) {\n\t\treturn string[0].toUpperCase() + string.slice(1);\n\t}\n\n\t/**\n\t * Get the percentage of a datapoint compared to the entire dataset.\n\t * @export\n\t * @param {any} item\n\t * @param {any} fullData\n\t * @returns The percentage in the form of a number (1 significant digit if necessary)\n\t */\n\texport function convertValueToPercentage(item, fullData) {\n\t\tconst percentage =\n\t\t\t(item / fullData.reduce((accum, val) => accum + val.value, 0)) *\n\t\t\t100;\n\t\t// if the value has any significant figures, keep 1\n\t\treturn percentage % 1 !== 0\n\t\t\t? parseFloat(percentage.toFixed(1))\n\t\t\t: percentage;\n\t}\n\n\t/**************************************\n\t * Object/array related checks *\n\t *************************************/\n\n\t/**\n\t * Compares two arrays to return the difference between two arrays' items.\n\t *\n\t * @export\n\t * @param {any[]} oldArray the array to check for missing items\n\t * @param {any[]} newArray the array to check for newly added items\n\t * @returns An object containing items missing (existing in oldArray but not newArray)\n\t * and items added (existing in newArray but not in oldArray). Object is of the form { missing: [], added: [] }\n\t */\n\texport function arrayDifferences(oldArray: any[], newArray: any[]) {\n\t\tconst difference = {\n\t\t\tmissing: [],\n\t\t\tadded: [],\n\t\t};\n\n\t\toldArray.forEach((element) => {\n\t\t\tif (newArray.indexOf(element) === -1) {\n\t\t\t\tdifference.missing.push(element);\n\t\t\t}\n\t\t});\n\n\t\tnewArray.forEach((element) => {\n\t\t\tif (oldArray.indexOf(element) === -1) {\n\t\t\t\tdifference.added.push(element);\n\t\t\t}\n\t\t});\n\n\t\treturn difference;\n\t}\n\n\t/**\n\t * Gets the duplicated keys from an array of data\n\t *\n\t * @export\n\t * @param {*} data - array of data\n\t * @returns A list of the duplicated keys in data\n\t */\n\texport function getDuplicateValues(arr: any) {\n\t\tconst values = [];\n\t\tconst duplicateValues = [];\n\n\t\tarr.forEach((value) => {\n\t\t\tif (\n\t\t\t\tvalues.indexOf(value) !== -1 &&\n\t\t\t\tduplicateValues.indexOf(value) === -1\n\t\t\t) {\n\t\t\t\tduplicateValues.push(value);\n\t\t\t}\n\n\t\t\tvalues.push(value);\n\t\t});\n\n\t\treturn duplicateValues;\n\t}\n\n\t// ================================================================================\n\t// D3 Extensions\n\t// ================================================================================\n\n\t/**\n\t * In D3, moves an element to the front of the canvas\n\t *\n\t * @export\n\t * @param {any} element input element to moved in front\n\t * @returns The function to be used by D3 to push element to the top of the canvas\n\t */\n\texport function moveToFront(element) {\n\t\treturn element.each(function () {\n\t\t\tthis.parentNode.appendChild(this);\n\t\t});\n\t}\n\n\t// ================================================================================\n\t// Style Helpers\n\t// ================================================================================\n\n\t/**\n\t * Gets a speicified property from within an object.\n\t *\n\t * @param object the object containing the property to retrieve\n\t * @param propPath nested properties used to extract the final property from within the object\n\t * (i.e \"style\", \"color\" would retrieve the color property from within an object that has \"color\" nested within \"style\")\n\t */\n\texport const getProperty = (object, ...propPath) => {\n\t\tlet position = object;\n\t\tif (position) {\n\t\t\tfor (const prop of propPath) {\n\t\t\t\tif (position[prop] !== null && position[prop] !== undefined) {\n\t\t\t\t\tposition = position[prop];\n\t\t\t\t} else {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn position;\n\t\t}\n\n\t\treturn null;\n\t};\n\n\tinterface SVGPathCoordinates {\n\t\tx0: number;\n\t\tx1: number;\n\t\ty0: number;\n\t\ty1: number;\n\t}\n\n\texport const flipSVGCoordinatesBasedOnOrientation = (\n\t\tverticalCoordinates: SVGPathCoordinates,\n\t\torientation?: CartesianOrientations\n\t) => {\n\t\tif (orientation === CartesianOrientations.HORIZONTAL) {\n\t\t\treturn {\n\t\t\t\ty0: verticalCoordinates.x0,\n\t\t\t\ty1: verticalCoordinates.x1,\n\t\t\t\tx0: verticalCoordinates.y0,\n\t\t\t\tx1: verticalCoordinates.y1,\n\t\t\t};\n\t\t}\n\n\t\treturn verticalCoordinates;\n\t};\n\n\texport const generateSVGPathString = (\n\t\tverticalCoordinates: SVGPathCoordinates,\n\t\torientation?: CartesianOrientations\n\t) => {\n\t\tconst { x0, x1, y0, y1 } = flipSVGCoordinatesBasedOnOrientation(\n\t\t\tverticalCoordinates,\n\t\t\torientation\n\t\t);\n\n\t\treturn `M${x0},${y0}L${x0},${y1}L${x1},${y1}L${x1},${y0}L${x0},${y0}`;\n\t};\n\n\texport function flipDomainAndRangeBasedOnOrientation<D, R>(\n\t\tdomain: D,\n\t\trange: R,\n\t\torientation?: CartesianOrientations\n\t): [D, R] | [R, D] {\n\t\treturn orientation === CartesianOrientations.VERTICAL\n\t\t\t? [domain, range]\n\t\t\t: [range, domain];\n\t}\n\n\texport const compareNumeric = (a: Numeric, b: Numeric) =>\n\t\tNumber(a) === Number(b);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["tools.ts"],"names":[],"mappings":"AAAA,mBAAmB;AACnB,OAAO,EAEN,qBAAqB,EACrB,UAAU,EACV,eAAe,EACf,MAAM,cAAc,CAAC;AAEtB,OAAO,EACN,QAAQ,IAAI,cAAc,EAC1B,KAAK,IAAI,WAAW,EACpB,SAAS,IAAI,eAAe,EAC5B,IAAI,IAAI,YAAY,EACpB,KAAK,IAAI,WAAW,EACpB,OAAO,IAAI,aAAa,EACxB,WAAW,IAAI,iBAAiB,EAChC,SAAS,IAAI,eAAe,EAC5B,SAAS,IAAI,eAAe,EAC5B,IAAI,IAAI,UAAU,EAIlB,MAAM,WAAW,CAAC;AAGnB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EAAE,SAAI,EAAE,SAAI,EAAE,SAAI,EAAE,SAAI,EAAE,SAAI,EAAE,SAAI,EAAE,SAAI,EAAE,SAAI,EAAI,CAAC;IACvE,CAAC,CAAC;IAEF,SAAgB,oCAAoC,CACnD,MAAS,EACT,KAAQ,EACR,WAAmC;QAEnC,OAAO,WAAW,KAAK,qBAAqB,CAAC,QAAQ;YACpD,CAAC,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC;YACjB,CAAC,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACpB,CAAC;IARe,0CAAoC,uCAQnD,CAAA;IAEY,oBAAc,GAAG,UAAC,CAAU,EAAE,CAAU;QACpD,OAAA,MAAM,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC;IAAvB,CAAuB,CAAC;AAC1B,CAAC,EAjXgB,KAAK,KAAL,KAAK,QAiXrB","sourcesContent":["// Internal imports\nimport {\n\tAxisChartOptions,\n\tCartesianOrientations,\n\tScaleTypes,\n\tTruncationTypes\n} from \"./interfaces\";\n\nimport {\n\tdebounce as lodashDebounce,\n\tmerge as lodashMerge,\n\tcloneDeep as lodashCloneDeep,\n\tuniq as lodashUnique,\n\tclamp as lodashClamp,\n\tisEqual as lodashIsEqual,\n\tflatMapDeep as lodashFlatMapDeep,\n\tkebabCase as lodashKebabCase,\n\tfromPairs as lodashFromPairs,\n\tsome as lodashSome,\n\t// the imports below are needed because of typescript bug (error TS4029)\n\tCancelable,\n\tDebounceSettings\n} from \"lodash-es\";\nimport { Numeric } from \"d3\";\n\n// Functions\nexport namespace Tools {\n\t// Export these functions from lodash\n\texport const debounce = lodashDebounce;\n\texport const clone = lodashCloneDeep;\n\texport const merge = lodashMerge;\n\texport const removeArrayDuplicates = lodashUnique;\n\texport const clamp = lodashClamp;\n\texport const isEqual = lodashIsEqual;\n\texport const flatMapDeep = lodashFlatMapDeep;\n\texport const kebabCase = lodashKebabCase;\n\texport const fromPairs = lodashFromPairs;\n\texport const some = lodashSome;\n\n\t/**\n\t * Returns default chart options merged with provided options,\n\t * with special cases for axes.\n\t * Axes object will not merge the not provided axes.\n\t *\n\t * @export\n\t * @param {AxisChartOptions} defaultOptions Configuration.options[chartType]\n\t * @param {AxisChartOptions} providedOptions user provided options\n\t * @returns merged options\n\t */\n\texport function mergeDefaultChartOptions(\n\t\tdefaultOptions: any,\n\t\tprovidedOptions: any\n\t) {\n\t\tdefaultOptions = Tools.clone(defaultOptions);\n\t\tconst providedAxesNames = Object.keys(providedOptions.axes || {});\n\n\t\tif (providedAxesNames.length === 0) {\n\t\t\tdelete defaultOptions.axes;\n\t\t}\n\n\t\t// Update deprecated options to work with the tabular data format\n\t\t// Similar to the functionality in model.transformToTabularData()\n\t\tfor (const axisName in defaultOptions.axes) {\n\t\t\tif (providedAxesNames.includes(axisName)) {\n\t\t\t\tconst providedAxisOptions = providedOptions.axes[axisName];\n\n\t\t\t\tif (\n\t\t\t\t\tprovidedAxisOptions[\"primary\"] ||\n\t\t\t\t\tprovidedAxisOptions[\"secondary\"]\n\t\t\t\t) {\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t\"`primary` & `secondary` are no longer needed for axis configurations. Read more here https://carbon-design-system.github.io/carbon-charts/?path=/story/tutorials--tabular-data-format\"\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst identifier = providedAxisOptions[\"mapsTo\"];\n\t\t\t\tif (identifier === undefined || identifier === null) {\n\t\t\t\t\tconst scaleType = providedAxisOptions[\"scaleType\"];\n\n\t\t\t\t\tif (scaleType === undefined || scaleType === null) {\n\t\t\t\t\t\tprovidedAxisOptions[\"mapsTo\"] = \"value\";\n\t\t\t\t\t} else if (scaleType === ScaleTypes.TIME) {\n\t\t\t\t\t\tprovidedAxisOptions[\"mapsTo\"] = \"date\";\n\t\t\t\t\t} else if (scaleType === ScaleTypes.LABELS) {\n\t\t\t\t\t\tprovidedAxisOptions[\"mapsTo\"] = \"key\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdelete defaultOptions.axes[axisName];\n\t\t\t}\n\t\t}\n\n\t\treturn Tools.merge(defaultOptions, providedOptions);\n\t}\n\n\t/**************************************\n\t * DOM-related operations *\n\t *************************************/\n\n\t/**\n\t * Get width & height of an element\n\t *\n\t * @export\n\t * @param {any} el element to get dimensions from\n\t * @returns an object containing the width and height of el\n\t */\n\texport function getDimensions(el) {\n\t\treturn {\n\t\t\twidth: parseFloat(\n\t\t\t\tel.style.width.replace(\"px\", \"\") || el.offsetWidth\n\t\t\t),\n\t\t\theight: parseFloat(\n\t\t\t\tel.style.height.replace(\"px\", \"\") || el.offsetHeight\n\t\t\t)\n\t\t};\n\t}\n\n\t/**\n\t * Gets elements's x and y translations from transform attribute or returns null\n\t *\n\t * @param {HTMLElement} element\n\t * @returns an object containing the translated x and y values or null\n\t */\n\texport function getTranslationValues(elementRef: HTMLElement) {\n\t\tif (!elementRef) {\n\t\t\treturn;\n\t\t}\n\n\t\t// regex to ONLY get values for translate (instead of all rotate, translate, skew, etc)\n\t\tconst translateRegex = /translate\\([0-9]+\\.?[0-9]*,[0-9]+\\.?[0-9]*\\)/;\n\n\t\tconst transformStr = elementRef\n\t\t\t.getAttribute(\"transform\")\n\t\t\t.match(translateRegex);\n\t\tif (!transformStr) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// check for the match\n\t\tif (transformStr[0]) {\n\t\t\tconst transforms = transformStr[0]\n\t\t\t\t.replace(/translate\\(/, \"\")\n\t\t\t\t.replace(/\\)/, \"\")\n\t\t\t\t.split(\",\");\n\n\t\t\treturn {\n\t\t\t\ttx: transforms[0],\n\t\t\t\tty: transforms[1]\n\t\t\t};\n\t\t}\n\t\treturn null;\n\t}\n\n\t/**************************************\n\t * Formatting & calculations *\n\t *************************************/\n\n\t/**\n\t * Gets x and y coordinates from HTML transform attribute\n\t *\n\t * @export\n\t * @param {any} string the transform attribute string ie. transform(x,y)\n\t * @returns Returns an object with x and y offsets of the transform\n\t */\n\texport function getTranformOffsets(string) {\n\t\tconst regExp = /\\(([^)]+)\\)/;\n\t\tconst match = regExp.exec(string)[1];\n\t\tconst xyString = match.split(\",\");\n\n\t\treturn {\n\t\t\tx: parseFloat(xyString[0]),\n\t\t\ty: parseFloat(xyString[1])\n\t\t};\n\t}\n\n\t/**\n\t * Returns string value for height/width using pixels if there isn't a specified unit of measure\n\t *\n\t * @param value string or number value to be checked for unit of measure\n\t */\n\texport function formatWidthHeightValues(value) {\n\t\tconst stringValue = value.toString();\n\n\t\t// If the value provided contains any letters\n\t\t// Return it the same way\n\t\tif (stringValue.match(/[a-z]/i)) {\n\t\t\treturn stringValue;\n\t\t}\n\n\t\treturn stringValue + \"px\";\n\t}\n\n\t/**\n\t * Capitalizes first letter of a string\n\t *\n\t * @export\n\t * @param {any} string the input string to perform first letter capitalization with\n\t * @returns The transformed string after first letter is capitalized\n\t */\n\texport function capitalizeFirstLetter(string) {\n\t\treturn string[0].toUpperCase() + string.slice(1);\n\t}\n\n\t/**\n\t * Get the percentage of a datapoint compared to the entire dataset.\n\t * @export\n\t * @param {any} item\n\t * @param {any} fullData\n\t * @returns The percentage in the form of a number (1 significant digit if necessary)\n\t */\n\texport function convertValueToPercentage(item, fullData) {\n\t\tconst percentage =\n\t\t\t(item / fullData.reduce((accum, val) => accum + val.value, 0)) *\n\t\t\t100;\n\t\t// if the value has any significant figures, keep 1\n\t\treturn percentage % 1 !== 0\n\t\t\t? parseFloat(percentage.toFixed(1))\n\t\t\t: percentage;\n\t}\n\n\t/**\n\t * Truncate the labels\n\t * @export\n\t * @param {any} fullText\n\t * @param {any} truncationType\n\t * @param {any} numCharacter\n\t * @returns Truncated text\n\t */\n\texport function truncateLabel(fullText, truncationType, numCharacter) {\n\t\tif (numCharacter > fullText.length) {\n\t\t\treturn fullText;\n\t\t}\n\t\tif (truncationType === TruncationTypes.MID_LINE) {\n\t\t\treturn (\n\t\t\t\tfullText.substr(0, numCharacter / 2) +\n\t\t\t\t\"...\" +\n\t\t\t\tfullText.substr(-numCharacter / 2)\n\t\t\t);\n\t\t} else if (truncationType === TruncationTypes.FRONT_LINE) {\n\t\t\treturn \"...\" + fullText.substr(-numCharacter);\n\t\t} else if (truncationType === TruncationTypes.END_LINE) {\n\t\t\treturn fullText.substr(0, numCharacter) + \"...\";\n\t\t}\n\t}\n\n\t/**************************************\n\t * Object/array related checks *\n\t *************************************/\n\n\t/**\n\t * Compares two arrays to return the difference between two arrays' items.\n\t *\n\t * @export\n\t * @param {any[]} oldArray the array to check for missing items\n\t * @param {any[]} newArray the array to check for newly added items\n\t * @returns An object containing items missing (existing in oldArray but not newArray)\n\t * and items added (existing in newArray but not in oldArray). Object is of the form { missing: [], added: [] }\n\t */\n\texport function arrayDifferences(oldArray: any[], newArray: any[]) {\n\t\tconst difference = {\n\t\t\tmissing: [],\n\t\t\tadded: []\n\t\t};\n\n\t\toldArray.forEach((element) => {\n\t\t\tif (newArray.indexOf(element) === -1) {\n\t\t\t\tdifference.missing.push(element);\n\t\t\t}\n\t\t});\n\n\t\tnewArray.forEach((element) => {\n\t\t\tif (oldArray.indexOf(element) === -1) {\n\t\t\t\tdifference.added.push(element);\n\t\t\t}\n\t\t});\n\n\t\treturn difference;\n\t}\n\n\t/**\n\t * Gets the duplicated keys from an array of data\n\t *\n\t * @export\n\t * @param {*} data - array of data\n\t * @returns A list of the duplicated keys in data\n\t */\n\texport function getDuplicateValues(arr: any) {\n\t\tconst values = [];\n\t\tconst duplicateValues = [];\n\n\t\tarr.forEach((value) => {\n\t\t\tif (\n\t\t\t\tvalues.indexOf(value) !== -1 &&\n\t\t\t\tduplicateValues.indexOf(value) === -1\n\t\t\t) {\n\t\t\t\tduplicateValues.push(value);\n\t\t\t}\n\n\t\t\tvalues.push(value);\n\t\t});\n\n\t\treturn duplicateValues;\n\t}\n\n\t// ================================================================================\n\t// D3 Extensions\n\t// ================================================================================\n\n\t/**\n\t * In D3, moves an element to the front of the canvas\n\t *\n\t * @export\n\t * @param {any} element input element to moved in front\n\t * @returns The function to be used by D3 to push element to the top of the canvas\n\t */\n\texport function moveToFront(element) {\n\t\treturn element.each(function () {\n\t\t\tthis.parentNode.appendChild(this);\n\t\t});\n\t}\n\n\t// ================================================================================\n\t// Style Helpers\n\t// ================================================================================\n\n\t/**\n\t * Gets a speicified property from within an object.\n\t *\n\t * @param object the object containing the property to retrieve\n\t * @param propPath nested properties used to extract the final property from within the object\n\t * (i.e \"style\", \"color\" would retrieve the color property from within an object that has \"color\" nested within \"style\")\n\t */\n\texport const getProperty = (object, ...propPath) => {\n\t\tlet position = object;\n\t\tif (position) {\n\t\t\tfor (const prop of propPath) {\n\t\t\t\tif (position[prop] !== null && position[prop] !== undefined) {\n\t\t\t\t\tposition = position[prop];\n\t\t\t\t} else {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn position;\n\t\t}\n\n\t\treturn null;\n\t};\n\n\tinterface SVGPathCoordinates {\n\t\tx0: number;\n\t\tx1: number;\n\t\ty0: number;\n\t\ty1: number;\n\t}\n\n\texport const flipSVGCoordinatesBasedOnOrientation = (\n\t\tverticalCoordinates: SVGPathCoordinates,\n\t\torientation?: CartesianOrientations\n\t) => {\n\t\tif (orientation === CartesianOrientations.HORIZONTAL) {\n\t\t\treturn {\n\t\t\t\ty0: verticalCoordinates.x0,\n\t\t\t\ty1: verticalCoordinates.x1,\n\t\t\t\tx0: verticalCoordinates.y0,\n\t\t\t\tx1: verticalCoordinates.y1\n\t\t\t};\n\t\t}\n\n\t\treturn verticalCoordinates;\n\t};\n\n\texport const generateSVGPathString = (\n\t\tverticalCoordinates: SVGPathCoordinates,\n\t\torientation?: CartesianOrientations\n\t) => {\n\t\tconst { x0, x1, y0, y1 } = flipSVGCoordinatesBasedOnOrientation(\n\t\t\tverticalCoordinates,\n\t\t\torientation\n\t\t);\n\n\t\treturn `M${x0},${y0}L${x0},${y1}L${x1},${y1}L${x1},${y0}L${x0},${y0}`;\n\t};\n\n\texport function flipDomainAndRangeBasedOnOrientation<D, R>(\n\t\tdomain: D,\n\t\trange: R,\n\t\torientation?: CartesianOrientations\n\t): [D, R] | [R, D] {\n\t\treturn orientation === CartesianOrientations.VERTICAL\n\t\t\t? [domain, range]\n\t\t\t: [range, domain];\n\t}\n\n\texport const compareNumeric = (a: Numeric, b: Numeric) =>\n\t\tNumber(a) === Number(b);\n}\n"]}
|