@milaboratories/miplots4 1.2.3 → 1.3.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.
Files changed (37) hide show
  1. package/dist/discrete/components/layers/ErrorBarElement.d.ts.map +1 -1
  2. package/dist/discrete/components/layers/ErrorBarElement.js +1 -0
  3. package/dist/discrete/components/layers/ErrorBarElement.js.map +1 -1
  4. package/dist/discrete/components/layers/LineElement.d.ts.map +1 -1
  5. package/dist/discrete/components/layers/LineElement.js +1 -0
  6. package/dist/discrete/components/layers/LineElement.js.map +1 -1
  7. package/dist/heatmap/ChartRenderer.d.ts.map +1 -1
  8. package/dist/heatmap/ChartRenderer.js +72 -78
  9. package/dist/heatmap/ChartRenderer.js.map +1 -1
  10. package/dist/scatterplot/ChartRenderer.d.ts.map +1 -1
  11. package/dist/scatterplot/ChartRenderer.js +2 -1
  12. package/dist/scatterplot/ChartRenderer.js.map +1 -1
  13. package/dist/scatterplot/ScatterplotSettingsImpl.d.ts +1 -0
  14. package/dist/scatterplot/ScatterplotSettingsImpl.d.ts.map +1 -1
  15. package/dist/scatterplot/ScatterplotSettingsImpl.js +2 -1
  16. package/dist/scatterplot/ScatterplotSettingsImpl.js.map +1 -1
  17. package/dist/scatterplot/components/ChartTrendsData.d.ts.map +1 -1
  18. package/dist/scatterplot/components/ChartTrendsData.js +2 -1
  19. package/dist/scatterplot/components/ChartTrendsData.js.map +1 -1
  20. package/dist/scatterplot/components/types.d.ts +1 -0
  21. package/dist/scatterplot/components/types.d.ts.map +1 -1
  22. package/dist/scatterplot-umap/ChartRenderer.d.ts.map +1 -1
  23. package/dist/scatterplot-umap/ChartRenderer.js +2 -0
  24. package/dist/scatterplot-umap/ChartRenderer.js.map +1 -1
  25. package/dist/scatterplot-umap/components/LowerSVG.js +1 -1
  26. package/dist/scatterplot-umap/components/LowerSVG.js.map +1 -1
  27. package/dist/scatterplot-umap/types.d.ts +1 -0
  28. package/dist/scatterplot-umap/types.d.ts.map +1 -1
  29. package/dist/types/scatterplot.d.ts +5 -0
  30. package/dist/types/scatterplot.d.ts.map +1 -1
  31. package/dist/types/scatterplot.js +2 -1
  32. package/dist/types/scatterplot.js.map +1 -1
  33. package/dist/utils/computeChartInnerSize.d.ts +18 -0
  34. package/dist/utils/computeChartInnerSize.d.ts.map +1 -0
  35. package/dist/utils/computeChartInnerSize.js +22 -0
  36. package/dist/utils/computeChartInnerSize.js.map +1 -0
  37. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorBarElement.d.ts","sourceRoot":"","sources":["../../../../src/discrete/components/layers/ErrorBarElement.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,KAAK,EAA+B,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG/E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,UAAU,aAAa;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,WAAW,CAAC;IACpB,QAAQ,EAAE,QAAQ,CAAC;IACnB,WAAW,EAAE,WAAW,CAAC;IACzB,GAAG,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC;IAC1B,aAAa,EAAE;QACX,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IACpC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAmBD,wBAAgB,eAAe,CAAC,EAC5B,QAAQ,EACR,MAAM,EACN,WAAW,EACX,QAAQ,EACR,GAAG,EACH,aAAa,EACb,YAAY,EACZ,sBAAsB,EACtB,iBAAiB,EACjB,YAAY,GACf,EAAE,aAAa,2CAuEf"}
1
+ {"version":3,"file":"ErrorBarElement.d.ts","sourceRoot":"","sources":["../../../../src/discrete/components/layers/ErrorBarElement.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,KAAK,EAA+B,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG/E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,UAAU,aAAa;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,WAAW,CAAC;IACpB,QAAQ,EAAE,QAAQ,CAAC;IACnB,WAAW,EAAE,WAAW,CAAC;IACzB,GAAG,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC;IAC1B,aAAa,EAAE;QACX,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IACpC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAmBD,wBAAgB,eAAe,CAAC,EAC5B,QAAQ,EACR,MAAM,EACN,WAAW,EACX,QAAQ,EACR,GAAG,EACH,aAAa,EACb,YAAY,EACZ,sBAAsB,EACtB,iBAAiB,EACjB,YAAY,GACf,EAAE,aAAa,2CAwEf"}
@@ -13,6 +13,7 @@ function o(e, t, n, r) {
13
13
  function s({ facetKey: s, scales: c, orientation: l, errorBar: u, aes: d, sideDistances: f, showTooltips: p, activeElementContainer: m, tooltipsContainer: h, tooltipsData: g }) {
14
14
  let _ = l === "vertical", v = o(c, "lineColor", d.lineColor, u), y = o(c, "fillColor", d.fillColor, u), b = o(c, "dotShape", d.dotShape, u), x = (c.xPrimary(u.primaryGrouping) ?? 0) + c.xPrimary.bandwidth() / 2, S = d.width === "auto" ? c.xPrimary.bandwidth() * .2 : d.width, C = c.y(u.min), w = c.y(u.max), T = c.y(u.value), E = n(b, d.dotSize, y), D = m && g.fixed, O = g.selectedData === u && D, k = d.showDots ? /* @__PURE__ */ i("g", {
15
15
  transform: _ ? `translate(${x},${T})` : `translate(${T},${x})`,
16
+ strokeWidth: 1,
16
17
  children: [
17
18
  E,
18
19
  p && h && /* @__PURE__ */ r("circle", {
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorBarElement.js","names":[],"sources":["../../../../src/discrete/components/layers/ErrorBarElement.tsx"],"sourcesContent":["import { createPortal } from 'react-dom';\nimport type { TooltipsData } from '../../../common/Tooltip';\nimport { Tooltip } from '../../../common/Tooltip';\nimport type { AesItem, InheritAesDiscrete, Orientation } from '../../../types';\nimport { getPointShape } from '../../../utils/getPointShape';\nimport { numberFormat } from '../../../utils/numberFormat';\nimport type { ErrorBar } from '../../layers';\nimport type { ErrorBarsData } from '../../layers/types';\nimport type { ChartScales } from '../types';\n\ninterface ErrorBarProps {\n facetKey: string;\n scales: ChartScales;\n errorBar: ErrorBar;\n orientation: Orientation;\n aes: ErrorBarsData['aes'];\n sideDistances: {\n left: number;\n right: number;\n top: number;\n bottom: number;\n };\n showTooltips: boolean;\n tooltipsData: TooltipsData<unknown>;\n activeElementContainer?: Element;\n tooltipsContainer?: Element;\n}\n\nfunction getAesValue<ValueType>(\n scales: ChartScales,\n field: keyof AesItem,\n value: ValueType | InheritAesDiscrete,\n geom: ErrorBar\n): ValueType {\n if (value && typeof value === 'object' && 'type' in value) {\n if (value.type === 'primaryGrouping') {\n return scales.xPrimaryAes(geom.primaryGrouping)[field] as ValueType;\n }\n if (value.type === 'secondaryGrouping') {\n return scales.xSecondaryAes(geom.secondaryGrouping)[field] as ValueType;\n }\n }\n return value as ValueType;\n}\n\nexport function ErrorBarElement({\n facetKey,\n scales,\n orientation,\n errorBar,\n aes,\n sideDistances,\n showTooltips,\n activeElementContainer,\n tooltipsContainer,\n tooltipsData,\n}: ErrorBarProps) {\n const isVertical = orientation === 'vertical';\n const lineColor = getAesValue(scales, 'lineColor', aes.lineColor, errorBar);\n const fillColor = getAesValue(scales, 'fillColor', aes.fillColor, errorBar);\n const dotShape = getAesValue(scales, 'dotShape', aes.dotShape, errorBar);\n const x = (scales.xPrimary(errorBar.primaryGrouping) ?? 0) + scales.xPrimary.bandwidth() / 2;\n const width = aes.width === 'auto' ? scales.xPrimary.bandwidth() * 0.2 : aes.width;\n const min = scales.y(errorBar.min);\n const max = scales.y(errorBar.max);\n const value = scales.y(errorBar.value);\n const shape = getPointShape(dotShape, aes.dotSize, fillColor);\n const dimmedBackground = activeElementContainer && tooltipsData.fixed;\n const highlightedDot = tooltipsData.selectedData === errorBar && dimmedBackground;\n\n const dot = aes.showDots ? (\n <g transform={isVertical ? `translate(${x},${value})` : `translate(${value},${x})`}>\n {shape}\n {showTooltips && tooltipsContainer && (\n <circle\n onMouseOver={() => tooltipsData.onMouseEnter(errorBar, facetKey)}\n onMouseLeave={() => tooltipsData.onMouseLeave()}\n r=\"15\"\n fill=\"transparent\"\n stroke=\"none\"\n />\n )}\n {showTooltips && (\n <Tooltip\n content={[numberFormat(errorBar.value)]}\n x={isVertical ? x : value}\n y={isVertical ? value : x}\n sideDistances={sideDistances}\n horizontal\n active={tooltipsData.active && tooltipsData.selectedData === errorBar && tooltipsData.currentFacet === facetKey}\n fixed={tooltipsData.fixed}\n onClose={tooltipsData.onClose}\n container={tooltipsContainer}\n />\n )}\n </g>\n ) : null;\n return (\n <g\n opacity={aes.opacity}\n stroke={lineColor}\n fill=\"none\"\n strokeWidth={aes.lineWidth}\n >\n <g transform={isVertical ? `translate(${x},0)` : `translate(0,${x})`}>\n <line\n x1={isVertical ? 0 : min}\n x2={isVertical ? 0 : max}\n y1={isVertical ? min : 0}\n y2={isVertical ? max : 0}\n />\n <line\n x1={isVertical ? -width / 2 : min}\n x2={isVertical ? width / 2 : min}\n y1={isVertical ? min : -width / 2}\n y2={isVertical ? min : width / 2}\n />\n <line\n x1={isVertical ? -width / 2 : max}\n x2={isVertical ? width / 2 : max}\n y1={isVertical ? max : -width / 2}\n y2={isVertical ? max : width / 2}\n />\n </g>\n {highlightedDot ? createPortal(dot, activeElementContainer) : dot}\n </g>\n );\n}\n"],"mappings":";;;;;AA4BA,SAAS,EACL,GACA,GACA,GACA,GACS;AACT,KAAI,KAAS,OAAO,KAAU,YAAY,UAAU,GAAO;AACvD,MAAI,EAAM,SAAS,kBACf,QAAO,EAAO,YAAY,EAAK,gBAAgB,CAAC;AAEpD,MAAI,EAAM,SAAS,oBACf,QAAO,EAAO,cAAc,EAAK,kBAAkB,CAAC;;AAG5D,QAAO;;AAGX,SAAgB,EAAgB,EAC5B,aACA,WACA,gBACA,aACA,QACA,kBACA,iBACA,2BACA,sBACA,mBACc;CACd,IAAM,IAAa,MAAgB,YAC7B,IAAY,EAAY,GAAQ,aAAa,EAAI,WAAW,EAAS,EACrE,IAAY,EAAY,GAAQ,aAAa,EAAI,WAAW,EAAS,EACrE,IAAW,EAAY,GAAQ,YAAY,EAAI,UAAU,EAAS,EAClE,KAAK,EAAO,SAAS,EAAS,gBAAgB,IAAI,KAAK,EAAO,SAAS,WAAW,GAAG,GACrF,IAAQ,EAAI,UAAU,SAAS,EAAO,SAAS,WAAW,GAAG,KAAM,EAAI,OACvE,IAAM,EAAO,EAAE,EAAS,IAAI,EAC5B,IAAM,EAAO,EAAE,EAAS,IAAI,EAC5B,IAAQ,EAAO,EAAE,EAAS,MAAM,EAChC,IAAQ,EAAc,GAAU,EAAI,SAAS,EAAU,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AAK,EAAuB,GAAG,EAC9D"}
1
+ {"version":3,"file":"ErrorBarElement.js","names":[],"sources":["../../../../src/discrete/components/layers/ErrorBarElement.tsx"],"sourcesContent":["import { createPortal } from 'react-dom';\nimport type { TooltipsData } from '../../../common/Tooltip';\nimport { Tooltip } from '../../../common/Tooltip';\nimport type { AesItem, InheritAesDiscrete, Orientation } from '../../../types';\nimport { getPointShape } from '../../../utils/getPointShape';\nimport { numberFormat } from '../../../utils/numberFormat';\nimport type { ErrorBar } from '../../layers';\nimport type { ErrorBarsData } from '../../layers/types';\nimport type { ChartScales } from '../types';\n\ninterface ErrorBarProps {\n facetKey: string;\n scales: ChartScales;\n errorBar: ErrorBar;\n orientation: Orientation;\n aes: ErrorBarsData['aes'];\n sideDistances: {\n left: number;\n right: number;\n top: number;\n bottom: number;\n };\n showTooltips: boolean;\n tooltipsData: TooltipsData<unknown>;\n activeElementContainer?: Element;\n tooltipsContainer?: Element;\n}\n\nfunction getAesValue<ValueType>(\n scales: ChartScales,\n field: keyof AesItem,\n value: ValueType | InheritAesDiscrete,\n geom: ErrorBar\n): ValueType {\n if (value && typeof value === 'object' && 'type' in value) {\n if (value.type === 'primaryGrouping') {\n return scales.xPrimaryAes(geom.primaryGrouping)[field] as ValueType;\n }\n if (value.type === 'secondaryGrouping') {\n return scales.xSecondaryAes(geom.secondaryGrouping)[field] as ValueType;\n }\n }\n return value as ValueType;\n}\n\nexport function ErrorBarElement({\n facetKey,\n scales,\n orientation,\n errorBar,\n aes,\n sideDistances,\n showTooltips,\n activeElementContainer,\n tooltipsContainer,\n tooltipsData,\n}: ErrorBarProps) {\n const isVertical = orientation === 'vertical';\n const lineColor = getAesValue(scales, 'lineColor', aes.lineColor, errorBar);\n const fillColor = getAesValue(scales, 'fillColor', aes.fillColor, errorBar);\n const dotShape = getAesValue(scales, 'dotShape', aes.dotShape, errorBar);\n const x = (scales.xPrimary(errorBar.primaryGrouping) ?? 0) + scales.xPrimary.bandwidth() / 2;\n const width = aes.width === 'auto' ? scales.xPrimary.bandwidth() * 0.2 : aes.width;\n const min = scales.y(errorBar.min);\n const max = scales.y(errorBar.max);\n const value = scales.y(errorBar.value);\n const shape = getPointShape(dotShape, aes.dotSize, fillColor);\n const dimmedBackground = activeElementContainer && tooltipsData.fixed;\n const highlightedDot = tooltipsData.selectedData === errorBar && dimmedBackground;\n\n const dot = aes.showDots ? (\n // Dot border must not scale with the error bar's lineWidth; keep it at the fixed default.\n <g transform={isVertical ? `translate(${x},${value})` : `translate(${value},${x})`} strokeWidth={1}>\n {shape}\n {showTooltips && tooltipsContainer && (\n <circle\n onMouseOver={() => tooltipsData.onMouseEnter(errorBar, facetKey)}\n onMouseLeave={() => tooltipsData.onMouseLeave()}\n r=\"15\"\n fill=\"transparent\"\n stroke=\"none\"\n />\n )}\n {showTooltips && (\n <Tooltip\n content={[numberFormat(errorBar.value)]}\n x={isVertical ? x : value}\n y={isVertical ? value : x}\n sideDistances={sideDistances}\n horizontal\n active={tooltipsData.active && tooltipsData.selectedData === errorBar && tooltipsData.currentFacet === facetKey}\n fixed={tooltipsData.fixed}\n onClose={tooltipsData.onClose}\n container={tooltipsContainer}\n />\n )}\n </g>\n ) : null;\n return (\n <g\n opacity={aes.opacity}\n stroke={lineColor}\n fill=\"none\"\n strokeWidth={aes.lineWidth}\n >\n <g transform={isVertical ? `translate(${x},0)` : `translate(0,${x})`}>\n <line\n x1={isVertical ? 0 : min}\n x2={isVertical ? 0 : max}\n y1={isVertical ? min : 0}\n y2={isVertical ? max : 0}\n />\n <line\n x1={isVertical ? -width / 2 : min}\n x2={isVertical ? width / 2 : min}\n y1={isVertical ? min : -width / 2}\n y2={isVertical ? min : width / 2}\n />\n <line\n x1={isVertical ? -width / 2 : max}\n x2={isVertical ? width / 2 : max}\n y1={isVertical ? max : -width / 2}\n y2={isVertical ? max : width / 2}\n />\n </g>\n {highlightedDot ? createPortal(dot, activeElementContainer) : dot}\n </g>\n );\n}\n"],"mappings":";;;;;AA4BA,SAAS,EACL,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,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,WAAW,CAAC;IACpB,IAAI,EAAE,IAAI,CAAC;IACX,WAAW,EAAE,WAAW,CAAC;IACzB,GAAG,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;IACtB,aAAa,EAAE;QACX,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,YAAY,EAAE,OAAO,CAAC;IACtB,iBAAiB,EAAE,YAAY,CAAC;IAChC,YAAY,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IACpC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAyCD,wBAAgB,WAAW,CAAC,EACxB,QAAQ,EACR,MAAM,EACN,WAAW,EACX,IAAI,EACJ,GAAG,EACH,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,YAAY,GACf,EAAE,SAAS,2CAoEX"}
1
+ {"version":3,"file":"LineElement.d.ts","sourceRoot":"","sources":["../../../../src/discrete/components/layers/LineElement.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,KAAK,EAAW,YAAY,EAAsB,WAAW,EAAc,MAAM,gBAAgB,CAAC;AAIzG,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,UAAU,SAAS;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,WAAW,CAAC;IACpB,IAAI,EAAE,IAAI,CAAC;IACX,WAAW,EAAE,WAAW,CAAC;IACzB,GAAG,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;IACtB,aAAa,EAAE;QACX,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,YAAY,EAAE,OAAO,CAAC;IACtB,iBAAiB,EAAE,YAAY,CAAC;IAChC,YAAY,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IACpC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAyCD,wBAAgB,WAAW,CAAC,EACxB,QAAQ,EACR,MAAM,EACN,WAAW,EACX,IAAI,EACJ,GAAG,EACH,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,YAAY,GACf,EAAE,SAAS,2CAsEX"}
@@ -41,6 +41,7 @@ function d({ facetKey: e, scales: d, orientation: f, line: p, aes: m, sideDistan
41
41
  transform: x ? `translate(${r},${c})` : `translate(${c},${r})`,
42
42
  strokeDasharray: "none",
43
43
  stroke: "none",
44
+ strokeWidth: 1,
44
45
  children: [
45
46
  D,
46
47
  g && y && /* @__PURE__ */ a("circle", {
@@ -1 +1 @@
1
- {"version":3,"file":"LineElement.js","names":[],"sources":["../../../../src/discrete/components/layers/LineElement.tsx"],"sourcesContent":["import { isArray } from 'lodash';\nimport { createPortal } from 'react-dom';\nimport type { TooltipsData } from '../../../common/Tooltip';\nimport { Tooltip } from '../../../common/Tooltip';\nimport type { AesItem, GroupingData, InheritAesDiscrete, Orientation, PointShape } from '../../../types';\nimport { getLineShape } from '../../../utils/getLineShape';\nimport { getPointShape } from '../../../utils/getPointShape';\nimport { numberFormat } from '../../../utils/numberFormat';\nimport type { Line } from '../../layers';\nimport type { LinesData } from '../../layers/types';\nimport type { ChartScales } from '../types';\n\ninterface LineProps {\n facetKey: string;\n scales: ChartScales;\n line: Line;\n orientation: Orientation;\n aes: LinesData['aes'];\n sideDistances: {\n left: number;\n right: number;\n top: number;\n bottom: number;\n };\n showTooltips: boolean;\n secondaryGrouping: GroupingData;\n tooltipsData: TooltipsData<unknown>;\n activeElementContainer?: Element;\n tooltipsContainer?: Element;\n}\n\nfunction getAesValue<ValueType>(\n scales: ChartScales,\n field: keyof AesItem,\n value: ValueType | InheritAesDiscrete,\n geom: Line\n): ValueType {\n if (value && typeof value === 'object' && 'type' in value) {\n if (value.type === 'primaryGrouping') {\n throw new Error('Line cannot have aesthetics by primary grouping');\n }\n if (value.type === 'secondaryGrouping') {\n return scales.xSecondaryAes(geom.key)[field] as ValueType;\n }\n }\n return value as ValueType;\n}\n\nfunction createPoints(\n points: Record<string, number>,\n primaryKeys: string[],\n scales: ChartScales\n): [number, number, string, number][] {\n const xShift = scales.xPrimary.bandwidth() / 2;\n return primaryKeys.map(\n key =>\n [(scales.xPrimary(key) ?? 0) + xShift, scales.y(points[key]), key, points[key]] as [\n number,\n number,\n string,\n number\n ]\n );\n}\n\nfunction getTooltipContent(secondaryGrouping:GroupingData, secondaryKey: string, value:number) {\n const keyLabel = secondaryGrouping.valueLabels[secondaryKey];\n return keyLabel ? [keyLabel, numberFormat(value)] : [numberFormat(value)];\n}\n\nexport function LineElement({\n facetKey,\n scales,\n orientation,\n line,\n aes,\n sideDistances,\n showTooltips,\n secondaryGrouping,\n activeElementContainer,\n tooltipsContainer,\n tooltipsData,\n}: LineProps) {\n const isVertical = orientation === 'vertical';\n const lineColor = getAesValue(scales, 'lineColor', aes.lineColor, line);\n const fillColor = getAesValue(scales, 'dotFill', aes.fillColor, line);\n const lineShape = getAesValue(scales, 'lineShape', aes.lineShape, line);\n const dotShape = getAesValue(scales, 'dotShape', aes.dotShape, line);\n const points = createPoints(line.dots, scales.xPrimary.domain(), scales);\n const shape = getPointShape(dotShape as PointShape, aes.dotSize, fillColor);\n const dimmedBackground = activeElementContainer && tooltipsData.fixed;\n\n return (\n <g\n opacity={aes.opacity}\n stroke={lineColor}\n strokeDasharray={getLineShape(lineShape)}\n strokeWidth={aes.lineWidth}\n >\n <polyline\n key={line.key}\n points={points.map(([x, y]) => (isVertical ? [x, y] : [y, x])).join(' ')}\n stroke={lineColor}\n fill=\"none\"\n />\n {aes.dotShape !== null && (\n <g>\n {points.map((geomValue) => {\n const [x, y, key, value] = geomValue;\n const data = tooltipsData.selectedData;\n const tooltipSelected = Boolean(data && facetKey === tooltipsData.currentFacet && isArray(data) && data.every((el, idx) => el === geomValue[idx]));\n const highlightedDot = tooltipSelected && dimmedBackground;\n const dot = (\n <g\n key={key}\n transform={isVertical ? `translate(${x},${y})` : `translate(${y},${x})`}\n strokeDasharray=\"none\"\n stroke=\"none\"\n >\n {shape}\n {showTooltips && tooltipsContainer && (\n <circle\n onMouseOver={() => tooltipsData.onMouseEnter(geomValue, facetKey)}\n onMouseLeave={() => tooltipsData.onMouseLeave()}\n r=\"15\"\n fill=\"transparent\"\n stroke=\"none\"\n />\n )}\n {showTooltips && (\n <Tooltip\n content={getTooltipContent(secondaryGrouping, line.key, value)}\n x={isVertical ? x : y}\n y={isVertical ? y : x}\n sideDistances={sideDistances}\n horizontal\n active={tooltipSelected}\n fixed={tooltipsData.fixed}\n onClose={tooltipsData.onClose}\n container={tooltipsContainer}\n />\n )}\n </g>\n );\n return highlightedDot ? createPortal(dot, activeElementContainer) : dot;\n })}\n </g>\n )}\n </g>\n );\n}\n"],"mappings":";;;;;;;AA+BA,SAAS,EACL,GACA,GACA,GACA,GACS;AACT,KAAI,KAAS,OAAO,KAAU,YAAY,UAAU,GAAO;AACvD,MAAI,EAAM,SAAS,kBACf,OAAU,MAAM,kDAAkD;AAEtE,MAAI,EAAM,SAAS,oBACf,QAAO,EAAO,cAAc,EAAK,IAAI,CAAC;;AAG9C,QAAO;;AAGX,SAAS,EACL,GACA,GACA,GACkC;CAClC,IAAM,IAAS,EAAO,SAAS,WAAW,GAAG;AAC7C,QAAO,EAAY,KACf,MACI;GAAE,EAAO,SAAS,EAAI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BAAC,KAAD;IAEI,WAAW,IAAa,aAAa,EAAE,GAAG,EAAE,KAAK,aAAa,EAAE,GAAG,EAAE;IACrE,iBAAgB;IAChB,QAAO;cAJX;KAMK;KACA,KAAgB,KACb,kBAAC,UAAD;MACI,mBAAmB,EAAa,aAAa,GAAW,EAAS;MACjE,oBAAoB,EAAa,cAAc;MAC/C,GAAE;MACF,MAAK;MACL,QAAO;MACT,CAAA;KAEL,KACG,kBAAC,GAAD;MACI,SAAS,EAAkB,GAAmB,EAAK,KAAK,EAAM;MAC9D,GAAG,IAAa,IAAI;MACpB,GAAG,IAAa,IAAI;MACL;MACf,YAAA;MACA,QAAQ;MACR,OAAO,EAAa;MACpB,SAAS,EAAa;MACtB,WAAW;MACb,CAAA;KAEN;MA5BK,EA4BL;AAER,UAAO,IAAiB,EAAa,GAAK,EAAuB,GAAG;IACtE,EACF,CAAA,CAER"}
1
+ {"version":3,"file":"LineElement.js","names":[],"sources":["../../../../src/discrete/components/layers/LineElement.tsx"],"sourcesContent":["import { isArray } from 'lodash';\nimport { createPortal } from 'react-dom';\nimport type { TooltipsData } from '../../../common/Tooltip';\nimport { Tooltip } from '../../../common/Tooltip';\nimport type { AesItem, GroupingData, InheritAesDiscrete, Orientation, PointShape } from '../../../types';\nimport { getLineShape } from '../../../utils/getLineShape';\nimport { getPointShape } from '../../../utils/getPointShape';\nimport { numberFormat } from '../../../utils/numberFormat';\nimport type { Line } from '../../layers';\nimport type { LinesData } from '../../layers/types';\nimport type { ChartScales } from '../types';\n\ninterface LineProps {\n facetKey: string;\n scales: ChartScales;\n line: Line;\n orientation: Orientation;\n aes: LinesData['aes'];\n sideDistances: {\n left: number;\n right: number;\n top: number;\n bottom: number;\n };\n showTooltips: boolean;\n secondaryGrouping: GroupingData;\n tooltipsData: TooltipsData<unknown>;\n activeElementContainer?: Element;\n tooltipsContainer?: Element;\n}\n\nfunction getAesValue<ValueType>(\n scales: ChartScales,\n field: keyof AesItem,\n value: ValueType | InheritAesDiscrete,\n geom: Line\n): ValueType {\n if (value && typeof value === 'object' && 'type' in value) {\n if (value.type === 'primaryGrouping') {\n throw new Error('Line cannot have aesthetics by primary grouping');\n }\n if (value.type === 'secondaryGrouping') {\n return scales.xSecondaryAes(geom.key)[field] as ValueType;\n }\n }\n return value as ValueType;\n}\n\nfunction createPoints(\n points: Record<string, number>,\n primaryKeys: string[],\n scales: ChartScales\n): [number, number, string, number][] {\n const xShift = scales.xPrimary.bandwidth() / 2;\n return primaryKeys.map(\n key =>\n [(scales.xPrimary(key) ?? 0) + xShift, scales.y(points[key]), key, points[key]] as [\n number,\n number,\n string,\n number\n ]\n );\n}\n\nfunction getTooltipContent(secondaryGrouping:GroupingData, secondaryKey: string, value:number) {\n const keyLabel = secondaryGrouping.valueLabels[secondaryKey];\n return keyLabel ? [keyLabel, numberFormat(value)] : [numberFormat(value)];\n}\n\nexport function LineElement({\n facetKey,\n scales,\n orientation,\n line,\n aes,\n sideDistances,\n showTooltips,\n secondaryGrouping,\n activeElementContainer,\n tooltipsContainer,\n tooltipsData,\n}: LineProps) {\n const isVertical = orientation === 'vertical';\n const lineColor = getAesValue(scales, 'lineColor', aes.lineColor, line);\n const fillColor = getAesValue(scales, 'dotFill', aes.fillColor, line);\n const lineShape = getAesValue(scales, 'lineShape', aes.lineShape, line);\n const dotShape = getAesValue(scales, 'dotShape', aes.dotShape, line);\n const points = createPoints(line.dots, scales.xPrimary.domain(), scales);\n const shape = getPointShape(dotShape as PointShape, aes.dotSize, fillColor);\n const dimmedBackground = activeElementContainer && tooltipsData.fixed;\n\n return (\n <g\n opacity={aes.opacity}\n stroke={lineColor}\n strokeDasharray={getLineShape(lineShape)}\n strokeWidth={aes.lineWidth}\n >\n <polyline\n key={line.key}\n points={points.map(([x, y]) => (isVertical ? [x, y] : [y, x])).join(' ')}\n stroke={lineColor}\n fill=\"none\"\n />\n {aes.dotShape !== null && (\n <g>\n {points.map((geomValue) => {\n const [x, y, key, value] = geomValue;\n const data = tooltipsData.selectedData;\n const tooltipSelected = Boolean(data && facetKey === tooltipsData.currentFacet && isArray(data) && data.every((el, idx) => el === geomValue[idx]));\n const highlightedDot = tooltipSelected && dimmedBackground;\n const dot = (\n <g\n key={key}\n transform={isVertical ? `translate(${x},${y})` : `translate(${y},${x})`}\n strokeDasharray=\"none\"\n stroke=\"none\"\n // Dot border must not scale with the line's lineWidth; keep it at the fixed default.\n strokeWidth={1}\n >\n {shape}\n {showTooltips && tooltipsContainer && (\n <circle\n onMouseOver={() => tooltipsData.onMouseEnter(geomValue, facetKey)}\n onMouseLeave={() => tooltipsData.onMouseLeave()}\n r=\"15\"\n fill=\"transparent\"\n stroke=\"none\"\n />\n )}\n {showTooltips && (\n <Tooltip\n content={getTooltipContent(secondaryGrouping, line.key, value)}\n x={isVertical ? x : y}\n y={isVertical ? y : x}\n sideDistances={sideDistances}\n horizontal\n active={tooltipSelected}\n fixed={tooltipsData.fixed}\n onClose={tooltipsData.onClose}\n container={tooltipsContainer}\n />\n )}\n </g>\n );\n return highlightedDot ? createPortal(dot, activeElementContainer) : dot;\n })}\n </g>\n )}\n </g>\n );\n}\n"],"mappings":";;;;;;;AA+BA,SAAS,EACL,GACA,GACA,GACA,GACS;AACT,KAAI,KAAS,OAAO,KAAU,YAAY,UAAU,GAAO;AACvD,MAAI,EAAM,SAAS,kBACf,OAAU,MAAM,kDAAkD;AAEtE,MAAI,EAAM,SAAS,oBACf,QAAO,EAAO,cAAc,EAAK,IAAI,CAAC;;AAG9C,QAAO;;AAGX,SAAS,EACL,GACA,GACA,GACkC;CAClC,IAAM,IAAS,EAAO,SAAS,WAAW,GAAG;AAC7C,QAAO,EAAY,KACf,MACI;GAAE,EAAO,SAAS,EAAI,IAAI,KAAK;EAAQ,EAAO,EAAE,EAAO,GAAK;EAAE;EAAK,EAAO;EAAK,CAMtF;;AAGL,SAAS,EAAkB,GAAgC,GAAsB,GAAc;CAC3F,IAAM,IAAW,EAAkB,YAAY;AAC/C,QAAO,IAAW,CAAC,GAAU,EAAa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AM,EAClB,aAAa,EAAE,mBAAmB,CAAC,eAAe,CAAC,EACnD,aAAa,EAAE,mBAAmB,CAAC,eAAe,CAAC,EACnD,GAAG,EAAE,mBAAmB,CAAC,KAAK,CAAC,EAC/B,gBAAgB,EAAE,mBAAmB,EACrC,WAAW,EAAE,mBAAmB,CAAC,aAAa,CAAC,EAC/C,WAAW,EAAE,UAAU,EACvB,WAAW,EAAE,mBAAmB,CAAC,aAAa,CAAC,EAC/C,WAAW,EAAE,mBAAmB,CAAC,aAAa,CAAC,EAC/C,eAAe,EAAE,eAAe,EAChC,sBAAsB,EAAE,mBAAmB,CAAC,wBAAwB,CAAC,EACrE,cAAc,EAAE,SAAS,EAAE,EAC3B,aAAa,EAAE,mBAAmB,CAAC,eAAe,CAAC,EACnD,mBAAmB,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,EACzC,kBAAkB,EAAE,QAAQ,GAAG,KAAK;IA6DxC,WAAW,CAAC,OAAO,EAAE,MAAM;CAG9B;AAED,eAAe,aAAa,CAAC"}
@@ -3,35 +3,36 @@ import { getContinuousLegendTicks as t } from "../utils/getContinuousLegendTicks
3
3
  import { TextMeasurer as n } from "../utils/TextMeasurer/TextMeasurer.js";
4
4
  import { DataFrameProvider as r } from "../common/useDataFrame.js";
5
5
  import { arrangeLegendParts as i } from "../utils/arrangeLegendParts.js";
6
- import { getChartEdgeSides as a } from "../utils/getChartEdgeSides.js";
7
- import { CHART_SIDE_ELEMENTS as o, DEFAULT_AES as s } from "./constants.js";
8
- import { ChartsGroup as c } from "./components/ChartsGroup.js";
9
- import { calculateChartSideElementSizes as l } from "./utils/calculateChartSideElementSizes.js";
10
- import { calculateSideElementsBBoxes as u } from "./utils/calculateSideElementsBBoxes.js";
11
- import { createContinuousColorScale as d, createDiscreteColorScale as f, createDiscreteRoundColorScale as p } from "./utils/createColorScales.js";
12
- import { calculateAnnotationTitleSizes as m } from "./utils/calculateAnnotationTitleSizes.js";
6
+ import { computeChartInnerSize as a } from "../utils/computeChartInnerSize.js";
7
+ import { getChartEdgeSides as o } from "../utils/getChartEdgeSides.js";
8
+ import { CHART_SIDE_ELEMENTS as s, DEFAULT_AES as c } from "./constants.js";
9
+ import { ChartsGroup as l } from "./components/ChartsGroup.js";
10
+ import { calculateChartSideElementSizes as u } from "./utils/calculateChartSideElementSizes.js";
11
+ import { calculateSideElementsBBoxes as d } from "./utils/calculateSideElementsBBoxes.js";
12
+ import { createContinuousColorScale as f, createDiscreteColorScale as p, createDiscreteRoundColorScale as m } from "./utils/createColorScales.js";
13
+ import { calculateAnnotationTitleSizes as h } from "./utils/calculateAnnotationTitleSizes.js";
13
14
  import "./utils/index.js";
14
- import { calculateCaptionTails as h } from "./utils/calculateCaptionTails.js";
15
- import g from "lodash";
16
- import { cluster as _ } from "d3-hierarchy";
17
- import { scaleLinear as v, scaleOrdinal as y } from "d3-scale";
18
- import { createRoot as b } from "react-dom/client";
19
- import { Fragment as x, jsx as S } from "react/jsx-runtime";
20
- import { extent as C } from "d3-array";
21
- var w = Math.cos(Math.PI / 4), T = 5;
22
- function E(e, t, n) {
15
+ import { calculateCaptionTails as g } from "./utils/calculateCaptionTails.js";
16
+ import _ from "lodash";
17
+ import { cluster as v } from "d3-hierarchy";
18
+ import { scaleLinear as y, scaleOrdinal as b } from "d3-scale";
19
+ import { createRoot as x } from "react-dom/client";
20
+ import { Fragment as S, jsx as C } from "react/jsx-runtime";
21
+ import { extent as w } from "d3-array";
22
+ var T = Math.cos(Math.PI / 4), E = 5;
23
+ function D(e, t, n) {
23
24
  function r(e) {
24
25
  e[n] = t(e.data.height), e.children && e.children.forEach(r);
25
26
  }
26
27
  r(e);
27
28
  }
28
- function D(e, t, n, r = n) {
29
+ function O(e, t, n, r = n) {
29
30
  function i(e) {
30
31
  e[r] = e[n] + t, e.children && e.children.forEach(i);
31
32
  }
32
33
  i(e);
33
34
  }
34
- var O = (e, t) => {
35
+ var k = (e, t) => {
35
36
  let n = Math.min(...t), r = Math.max(...t);
36
37
  if (n === r) {
37
38
  let t = e % 2 == 0 ? [] : [n];
@@ -43,11 +44,11 @@ var O = (e, t) => {
43
44
  for (let t = 0; t < e - 1; t++) a.push(n + i * t);
44
45
  return a.push(r), a;
45
46
  };
46
- function k(e, t, n) {
47
+ function A(e, t, n) {
47
48
  let r = n;
48
- return e && (e.colorRange && (r = e.colorRange), e.method === "standardScaling" && (r = [-2, 2]), e.method === "meanNormalization" && (r = [-.75, .75])), O(t, r);
49
+ return e && (e.colorRange && (r = e.colorRange), e.method === "standardScaling" && (r = [-2, 2]), e.method === "meanNormalization" && (r = [-.75, .75])), k(t, r);
49
50
  }
50
- function A(e, t, n) {
51
+ function j(e, t, n) {
51
52
  let r = 0;
52
53
  for (let i of e) {
53
54
  if (t[i] === void 0) continue;
@@ -56,14 +57,14 @@ function A(e, t, n) {
56
57
  }
57
58
  return r;
58
59
  }
59
- function j(e, t) {
60
- return t === 90 ? e : t === 45 ? e * w + (e > 0 ? 2 * T : 0) : 30;
60
+ function M(e, t) {
61
+ return t === 90 ? e : t === 45 ? e * T + (e > 0 ? 2 * E : 0) : 30;
61
62
  }
62
- var M = class {
63
+ var N = class {
63
64
  reactRoot = null;
64
65
  parentNode = null;
65
66
  rootNode = null;
66
- component = /* @__PURE__ */ S(x, {});
67
+ component = /* @__PURE__ */ C(S, {});
67
68
  chartsDimensions = {};
68
69
  chartSizes = {
69
70
  chartWidth: 600,
@@ -96,14 +97,14 @@ var M = class {
96
97
  columnsCount = 1;
97
98
  rowsCount = 1;
98
99
  scales = {
99
- x: { null: y().domain(["null"]).range([1]) },
100
- y: { null: y().domain(["null"]).range([1]) }
100
+ x: { null: b().domain(["null"]).range([1]) },
101
+ y: { null: b().domain(["null"]).range([1]) }
101
102
  };
102
103
  step = {
103
104
  x: {},
104
105
  y: {}
105
106
  };
106
- colorScale = v().domain([0, 1]).range(["white", "black"]);
107
+ colorScale = y().domain([0, 1]).range(["white", "black"]);
107
108
  annotationColorScales = {};
108
109
  dendrogramAesScales = {};
109
110
  legend = {
@@ -118,7 +119,7 @@ var M = class {
118
119
  });
119
120
  }
120
121
  init(e) {
121
- this.parentNode === null && (this.parentNode = e, this.rootNode = document.createElement("div"), this.parentNode.appendChild(this.rootNode), this.reactRoot = b(this.rootNode));
122
+ this.parentNode === null && (this.parentNode = e, this.rootNode = document.createElement("div"), this.parentNode.appendChild(this.rootNode), this.reactRoot = x(this.rootNode));
122
123
  }
123
124
  updateMargins(e, t) {
124
125
  this.margins = {
@@ -144,7 +145,7 @@ var M = class {
144
145
  top: 0
145
146
  }, d = (e) => e.reduce((e, t) => (e[t] = String(t), e), {});
146
147
  if (e === "continuous") {
147
- let e = this.colorScale, n = t(e, o), r = v([n[0], n[n.length - 1]], [s, 0]), i = a.label ?? a.value;
148
+ let e = this.colorScale, n = t(e, o), r = y([n[0], n[n.length - 1]], [s, 0]), i = a.label ?? a.value;
148
149
  l.push({
149
150
  ...u,
150
151
  type: "continuous",
@@ -169,7 +170,7 @@ var M = class {
169
170
  if (r.forEach((e) => {
170
171
  let n = e.valueColumn.label ?? e.valueColumn.value;
171
172
  if (e.type === "continuous") {
172
- let r = this.annotationColorScales[e.id].scale, i = t(r, o), a = v([i[0], i[i.length - 1]], [s, 0]);
173
+ let r = this.annotationColorScales[e.id].scale, i = t(r, o), a = y([i[0], i[i.length - 1]], [s, 0]);
173
174
  l.push({
174
175
  ...u,
175
176
  type: "continuous",
@@ -215,26 +216,26 @@ var M = class {
215
216
  xGroupLabels: t.groupLabelsAngle,
216
217
  yGroupLabels: r.groupLabelsAngle
217
218
  };
218
- let m = o.reduce((e, t) => Math.max(e, A(u[t], f, a)), 0), g = s.reduce((e, t) => Math.max(e, A(d[t], p, a)), 0), _ = A(o, c, a), v = A(s, l, a), { xCaptionTail: y, yCaptionTail: b } = h(this.labelAngles, i, this.scales, this.step, e, a);
219
+ let m = o.reduce((e, t) => Math.max(e, j(u[t], f, a)), 0), h = s.reduce((e, t) => Math.max(e, j(d[t], p, a)), 0), _ = j(o, c, a), v = j(s, l, a), { xCaptionTail: y, yCaptionTail: b } = g(this.labelAngles, i, this.scales, this.step, e, a);
219
220
  this.captionsSizes = {
220
221
  xCaptionTail: y,
221
222
  yCaptionTail: b,
222
- xGroupCaptions: j(_, this.labelAngles.xGroupLabels),
223
- yGroupCaptions: j(v, this.labelAngles.yGroupLabels),
224
- xAxisCaptions: j(m, this.labelAngles.xAxisLabels),
225
- yAxisCaptions: j(g, this.labelAngles.yAxisLabels)
223
+ xGroupCaptions: M(_, this.labelAngles.xGroupLabels),
224
+ yGroupCaptions: M(v, this.labelAngles.yGroupLabels),
225
+ xAxisCaptions: M(m, this.labelAngles.xAxisLabels),
226
+ yAxisCaptions: M(h, this.labelAngles.yAxisLabels)
226
227
  };
227
228
  }
228
- updateChartDimensions(e, t, n, r, i, s, c, d, f, p) {
229
- let h = t.length, g = Math.min(i.nRows ?? h, h), _ = Math.min(i.nCols ?? h, h);
230
- this.columnsCount = i.nRows ? Math.ceil(h / g) : _, this.rowsCount = Math.ceil(h / this.columnsCount);
229
+ updateChartDimensions(e, t, n, r, i, a, c, l, f, p) {
230
+ let m = t.length, g = Math.min(i.nRows ?? m, m), _ = Math.min(i.nCols ?? m, m);
231
+ this.columnsCount = i.nRows ? Math.ceil(m / g) : _, this.rowsCount = Math.ceil(m / this.columnsCount);
231
232
  let { sharedX: v, sharedY: y } = i;
232
233
  this.chartsDimensions = {};
233
234
  let b = 0, x = 0;
234
- t.forEach((i, h) => {
235
- let g = h % this.columnsCount + 1, _ = a(h, t.length, this.columnsCount, this.rowsCount), S = this.step.x[i], C = this.step.y[i], w = l(s, c, this.captionsSizes, d, f, p, _, v, y, t, n, r, S, C), T = m(d, _, v, y);
235
+ t.forEach((i, m) => {
236
+ let g = m % this.columnsCount + 1, _ = o(m, t.length, this.columnsCount, this.rowsCount), S = this.step.x[i], C = this.step.y[i], w = u(a, c, this.captionsSizes, l, f, p, _, v, y, t, n, r, S, C), T = h(l, _, v, y);
236
237
  function E(t) {
237
- return Math.max(o[t].reduce((e, n) => e + w[t][n], 0), T[t], e.innerOffset);
238
+ return Math.max(s[t].reduce((e, n) => e + w[t][n], 0), T[t], e.innerOffset);
238
239
  }
239
240
  let D = {
240
241
  left: E("left"),
@@ -243,7 +244,7 @@ var M = class {
243
244
  bottom: E("bottom")
244
245
  };
245
246
  D.left < this.captionsSizes.xCaptionTail && (D.left = this.captionsSizes.xCaptionTail), D.bottom < this.captionsSizes.yCaptionTail && (D.bottom = this.captionsSizes.yCaptionTail);
246
- let O = u(w, this.chartSizes.chartWidth, this.chartSizes.chartHeight), k = this.chartSizes.chartWidth + D.left + D.right, A = this.chartSizes.chartHeight + D.top + D.bottom;
247
+ let O = d(w, this.chartSizes.chartWidth, this.chartSizes.chartHeight), k = this.chartSizes.chartWidth + D.left + D.right, A = this.chartSizes.chartHeight + D.top + D.bottom;
247
248
  this.chartsDimensions[i] = {
248
249
  left: b,
249
250
  top: x,
@@ -264,23 +265,16 @@ var M = class {
264
265
  this.chartSizes.chartsWidth = S, this.chartSizes.chartsHeight = C;
265
266
  }
266
267
  updateChartsSizes(e, t, n) {
267
- let { width: r, height: i, cellWidth: a, cellHeight: o } = e, s = t.meta.facetKeys[0];
268
- if (a && s) {
269
- let e = t.facets[s].xKeys.length, r = t.meta.xGroupKeys.filter((e) => (t.facets[s]?.xKeysByGroups[e]?.length ?? 0) > 0).length;
270
- this.chartSizes.chartWidth = e * a + n * (r - 1);
271
- } else this.chartSizes.chartWidth = r;
272
- if (o && s) {
273
- let e = t.facets[s].yKeys.length, r = t.meta.yGroupKeys.filter((e) => (t.facets[s]?.yKeysByGroups[e]?.length ?? 0) > 0).length;
274
- this.chartSizes.chartHeight = e * o + n * (r - 1);
275
- } else this.chartSizes.chartHeight = i;
268
+ let { chartWidth: r, chartHeight: i } = a(e, t.meta, n);
269
+ this.chartSizes.chartWidth = r, this.chartSizes.chartHeight = i;
276
270
  }
277
271
  updateScales(e, t, n, r, i) {
278
272
  let { width: a, height: o, cellWidth: s, cellHeight: c } = i, { meta: l, facets: u } = t, { sharedX: d, sharedY: f } = r;
279
273
  e.forEach((e) => {
280
- let t = u[e], r = l.xGroupKeys, i = l.yGroupKeys, { xKeysByGroups: p } = d ? l : t, { yKeysByGroups: m } = f ? l : t, h = r.map((e) => p[e].length), g = i.map((e) => m[e].length), _ = h.reduce((e, t) => e + t, 0), v = g.reduce((e, t) => e + t, 0), b = s || (a - (h.filter((e) => e > 0).length - 1) * n) / _, x = c || (o - (g.filter((e) => e > 0).length - 1) * n) / v, S = [], C = [], w = 0, T = r.map((e) => p[e]);
274
+ let t = u[e], r = l.xGroupKeys, i = l.yGroupKeys, { xKeysByGroups: p } = d ? l : t, { yKeysByGroups: m } = f ? l : t, h = r.map((e) => p[e].length), g = i.map((e) => m[e].length), _ = h.reduce((e, t) => e + t, 0), v = g.reduce((e, t) => e + t, 0), y = s || (a - (h.filter((e) => e > 0).length - 1) * n) / _, x = c || (o - (g.filter((e) => e > 0).length - 1) * n) / v, S = [], C = [], w = 0, T = r.map((e) => p[e]);
281
275
  T.forEach((e, t) => {
282
276
  C = C.concat(e), e.forEach(() => {
283
- S.push(w), w += b;
277
+ S.push(w), w += y;
284
278
  });
285
279
  let r = T.slice(t + 1).some((e) => e.length > 0);
286
280
  e.length > 0 && r && (w += n);
@@ -292,31 +286,31 @@ var M = class {
292
286
  });
293
287
  let r = k.slice(t + 1).some((e) => e.length > 0);
294
288
  e.length > 0 && r && (O += n);
295
- }), this.scales.x[e] = y().domain(C).range(S), this.scales.y[e] = y().domain(D).range(E), this.step.x[e] = b, this.step.y[e] = x;
289
+ }), this.scales.x[e] = b().domain(C).range(S), this.scales.y[e] = b().domain(D).range(E), this.step.x[e] = y, this.step.y[e] = x;
296
290
  });
297
291
  }
298
292
  updateAesScale(e, t, n, r, i, a, o) {
299
- if (e === "continuous") n.valueColors ? this.colorScale = v().domain(n.valuesByColors ?? k(o, n.valueColors.length, t)).range(n.valueColors) : n.colorsList && (this.colorScale = v().domain(k(o, n.colorsList.length, t)).range(n.colorsList));
293
+ if (e === "continuous") n.valueColors ? this.colorScale = y().domain(n.valuesByColors ?? A(o, n.valueColors.length, t)).range(n.valueColors) : n.colorsList && (this.colorScale = y().domain(A(o, n.colorsList.length, t)).range(n.colorsList));
300
294
  else if (n.colorsMap) {
301
295
  let e = Object.entries(n.colorsMap);
302
- this.colorScale = y().domain(e.map((e) => e[0])).range(e.map((e) => e[1])).unknown("#ccc");
303
- } else n.colorsList && (this.colorScale = f(n.colorsList, a.map(String)));
296
+ this.colorScale = b().domain(e.map((e) => e[0])).range(e.map((e) => e[1])).unknown("#ccc");
297
+ } else n.colorsList && (this.colorScale = p(n.colorsList, a.map(String)));
304
298
  let { xDataByKeys: s, yDataByKeys: c } = i.meta;
305
299
  r.forEach((e) => {
306
300
  let { colors: t, type: n, axis: r, valueColumn: i } = e, a = (r === "x" ? s : c)[i.valueLabels ?? i.value];
307
301
  if (n === "discrete") {
308
- let n = g.uniq(Object.values(a).map(String)).sort();
302
+ let n = _.uniq(Object.values(a).map(String)).sort();
309
303
  this.annotationColorScales[e.id] = {
310
304
  type: "discrete",
311
- scale: p(t, n)
305
+ scale: m(t, n)
312
306
  };
313
307
  } else {
314
308
  let n = Object.values(a).map(Number);
315
309
  if (!n.length) return;
316
- let [r = n[0], i = n[0]] = C(n);
310
+ let [r = n[0], i = n[0]] = w(n);
317
311
  this.annotationColorScales[e.id] = {
318
312
  type: "continuous",
319
- scale: d(t, r, i, 0, .5, 1)
313
+ scale: f(t, r, i, 0, .5, 1)
320
314
  };
321
315
  }
322
316
  });
@@ -340,9 +334,9 @@ var M = class {
340
334
  let o = n[i];
341
335
  if (!o) return t;
342
336
  let c = s[i];
343
- _().separation(() => 1).size([o.leaves().length * this.step.x[e], a.size])(o);
337
+ v().separation(() => 1).size([o.leaves().length * this.step.x[e], a.size])(o);
344
338
  let l = o;
345
- return E(l, v().domain(a.position === "top" ? [0, r] : [r, 0]).range([a.size, 0]), "y"), D(l, this.scales.x[e](c[0]), "x"), t[i] = l, t;
339
+ return D(l, y().domain(a.position === "top" ? [0, r] : [r, 0]).range([a.size, 0]), "y"), O(l, this.scales.x[e](c[0]), "x"), t[i] = l, t;
346
340
  }, {}), this.dendrograms[e].x.data = a;
347
341
  }
348
342
  if (o) {
@@ -351,9 +345,9 @@ var M = class {
351
345
  let a = t[i];
352
346
  if (!a) return n;
353
347
  let s = c[i];
354
- _().separation(() => 1).size([a.leaves().length * this.step.y[e], o.size])(a);
355
- let l = a, u = v().domain(o.position === "left" ? [0, r] : [r, 0]).range([o.size, 0]);
356
- return D(l, this.scales.y[e](s[0]), "x", "y"), E(l, u, "x"), n[i] = l, n;
348
+ v().separation(() => 1).size([a.leaves().length * this.step.y[e], o.size])(a);
349
+ let l = a, u = y().domain(o.position === "left" ? [0, r] : [r, 0]).range([o.size, 0]);
350
+ return O(l, this.scales.y[e](s[0]), "x", "y"), D(l, u, "x"), n[i] = l, n;
357
351
  }, {}), this.dendrograms[e].y.data = o;
358
352
  }
359
353
  });
@@ -361,18 +355,18 @@ var M = class {
361
355
  updateDendrogramAesScales(e) {
362
356
  e && (this.dendrogramAesScales = Object.keys(e).reduce((t, n) => {
363
357
  let r = e[n], i = Object.keys(r);
364
- return t[n] = y().domain(i).range(i.map((e) => ({
365
- ...s,
358
+ return t[n] = b().domain(i).range(i.map((e) => ({
359
+ ...c,
366
360
  ...r[e]
367
- }))).unknown(s), t;
361
+ }))).unknown(c), t;
368
362
  }, {}));
369
363
  }
370
- render(e, t, n, i, a, o, s, l, u, d, f, p, m, h, g, _) {
371
- let { meta: v, facets: y } = o, { facetKeys: b, xGroupKeys: x, yGroupKeys: C, valueExtent: w } = v, { xAxis: T, yAxis: E, title: D, size: O, valueType: k } = n;
372
- this.updateChartsSizes(O, o, a.groupGap), this.updateAesScale(k, w.dataSource, a, s, o, m, h), this.updateScales(b, o, a.groupGap, i, O), this.updateCaptionsSize(o, T, E, i), this.updateChartDimensions(O, b, x, C, i, T, E, s, u, d), this.updateLegendSize(k, n.legend, s, l, w.dataSource), this.updateMargins(D, O), this.updateDendrogram(b, x, C, y, f, u, d), this.updateDendrogramAesScales(p);
373
- let A = /* @__PURE__ */ S(r, {
364
+ render(e, t, n, i, a, o, s, c, u, d, f, p, m, h, g, _) {
365
+ let { meta: v, facets: y } = o, { facetKeys: b, xGroupKeys: x, yGroupKeys: S, valueExtent: w } = v, { xAxis: T, yAxis: E, title: D, size: O, valueType: k } = n;
366
+ this.updateChartsSizes(O, o, a.groupGap), this.updateAesScale(k, w.dataSource, a, s, o, m, h), this.updateScales(b, o, a.groupGap, i, O), this.updateCaptionsSize(o, T, E, i), this.updateChartDimensions(O, b, x, S, i, T, E, s, u, d), this.updateLegendSize(k, n.legend, s, c, w.dataSource), this.updateMargins(D, O), this.updateDendrogram(b, x, S, y, f, u, d), this.updateDendrogramAesScales(p);
367
+ let A = /* @__PURE__ */ C(r, {
374
368
  dataFrame: e,
375
- children: /* @__PURE__ */ S(c, {
369
+ children: /* @__PURE__ */ C(l, {
376
370
  aes: a,
377
371
  annotations: s,
378
372
  annotationColorScales: this.annotationColorScales,
@@ -395,7 +389,7 @@ var M = class {
395
389
  settingsId: t,
396
390
  step: this.step,
397
391
  xGroupKeys: x,
398
- yGroupKeys: C,
392
+ yGroupKeys: S,
399
393
  onTooltipHintSwitch: g,
400
394
  cellsRenderingMode: _
401
395
  })
@@ -403,9 +397,9 @@ var M = class {
403
397
  this.component = A, this.reactRoot?.render(A);
404
398
  }
405
399
  renderError(t) {
406
- this.reactRoot?.render(/* @__PURE__ */ S(e, { message: t }));
400
+ this.reactRoot?.render(/* @__PURE__ */ C(e, { message: t }));
407
401
  }
408
402
  };
409
- export { M as default };
403
+ export { N as default };
410
404
 
411
405
  //# sourceMappingURL=ChartRenderer.js.map