@milaboratories/graph-maker 1.1.142 → 1.1.144

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 (147) hide show
  1. package/dist/GraphMaker/components/ReorderForm.vue.d.ts +15 -0
  2. package/dist/GraphMaker/components/ReorderForm.vue.d.ts.map +1 -0
  3. package/dist/GraphMaker/components/ReorderForm.vue.js +43 -0
  4. package/dist/GraphMaker/components/ReorderForm.vue.js.map +1 -0
  5. package/dist/GraphMaker/components/ReorderForm.vue2.js +5 -0
  6. package/dist/GraphMaker/components/ReorderForm.vue2.js.map +1 -0
  7. package/dist/GraphMaker/constantsCommon.d.ts +15 -0
  8. package/dist/GraphMaker/constantsCommon.d.ts.map +1 -1
  9. package/dist/GraphMaker/constantsCommon.js +11 -8
  10. package/dist/GraphMaker/constantsCommon.js.map +1 -1
  11. package/dist/GraphMaker/forms/AxesSettingsForm/DiscreteAxesSettingsForm.vue.js.map +1 -1
  12. package/dist/GraphMaker/forms/AxesSettingsForm/ScatterplotAxesSettingsForm.vue.d.ts.map +1 -1
  13. package/dist/GraphMaker/forms/AxesSettingsForm/ScatterplotAxesSettingsForm.vue.js +305 -172
  14. package/dist/GraphMaker/forms/AxesSettingsForm/ScatterplotAxesSettingsForm.vue.js.map +1 -1
  15. package/dist/GraphMaker/index.vue.d.ts.map +1 -1
  16. package/dist/GraphMaker/index.vue.js +33 -33
  17. package/dist/GraphMaker/index.vue.js.map +1 -1
  18. package/dist/GraphMaker/utils/createChartSettingsForRender/composeBubbleSettings.d.ts +3 -3
  19. package/dist/GraphMaker/utils/createChartSettingsForRender/composeBubbleSettings.d.ts.map +1 -1
  20. package/dist/GraphMaker/utils/createChartSettingsForRender/composeDendroSettings.d.ts +9 -9
  21. package/dist/GraphMaker/utils/createChartSettingsForRender/composeDendroSettings.d.ts.map +1 -1
  22. package/dist/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.d.ts +5 -11
  23. package/dist/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.d.ts.map +1 -1
  24. package/dist/GraphMaker/utils/createChartSettingsForRender/composeHeatmapSettings.d.ts +3 -3
  25. package/dist/GraphMaker/utils/createChartSettingsForRender/composeHeatmapSettings.d.ts.map +1 -1
  26. package/dist/GraphMaker/utils/createChartSettingsForRender/composeHistogramSettings.d.ts +1 -1
  27. package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.d.ts +31 -5
  28. package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.d.ts.map +1 -1
  29. package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.js +56 -53
  30. package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.js.map +1 -1
  31. package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.d.ts +1 -7
  32. package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.d.ts.map +1 -1
  33. package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.js +13 -13
  34. package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.js.map +1 -1
  35. package/dist/GraphMaker/utils/createChartSettingsForRender/getAxesDataFromForms.d.ts +6 -4
  36. package/dist/GraphMaker/utils/createChartSettingsForRender/getAxesDataFromForms.d.ts.map +1 -1
  37. package/dist/GraphMaker/utils/createChartSettingsForRender/getAxesDataFromForms.js +42 -13
  38. package/dist/GraphMaker/utils/createChartSettingsForRender/getAxesDataFromForms.js.map +1 -1
  39. package/dist/GraphMaker/utils/loadUniqueValuesToSave.d.ts.map +1 -1
  40. package/dist/GraphMaker/utils/loadUniqueValuesToSave.js +48 -44
  41. package/dist/GraphMaker/utils/loadUniqueValuesToSave.js.map +1 -1
  42. package/dist/node_modules/@milaboratories/miplots4/dist/{discrete/components → common}/BandAxis.js +3 -3
  43. package/dist/node_modules/@milaboratories/miplots4/dist/common/BandAxis.js.map +1 -0
  44. package/dist/node_modules/@milaboratories/miplots4/dist/common/ContinuousGrid.js.map +1 -1
  45. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/ChartRenderer.js +14 -14
  46. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/ChartRenderer.js +197 -270
  47. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/ChartRenderer.js.map +1 -1
  48. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/DiscreteSettingsImpl.js +9 -9
  49. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/components/Chart.js +1 -1
  50. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/components/Chart.js.map +1 -1
  51. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/components/Grid.js.map +1 -1
  52. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/index.js +11 -11
  53. package/dist/node_modules/@milaboratories/miplots4/dist/histogram/ChartRenderer.js +1 -1
  54. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-scale/src/band.js +44 -34
  55. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-scale/src/band.js.map +1 -1
  56. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/ChartRenderer.js +272 -195
  57. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/ChartRenderer.js.map +1 -1
  58. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/ScatterplotSettingsImpl.js +23 -23
  59. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/ScatterplotSettingsImpl.js.map +1 -1
  60. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/Chart.js +54 -50
  61. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/Chart.js.map +1 -1
  62. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartAxis.js +32 -28
  63. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartAxis.js.map +1 -1
  64. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartLayersData.js.map +1 -1
  65. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartTooltip.js.map +1 -1
  66. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartTrendsData.js +29 -26
  67. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartTrendsData.js.map +1 -1
  68. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartsGroup.js +44 -41
  69. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartsGroup.js.map +1 -1
  70. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/Grid.js +31 -27
  71. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/Grid.js.map +1 -1
  72. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/dots.js.map +1 -1
  73. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/getLayersData.js +29 -18
  74. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/getLayersData.js.map +1 -1
  75. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/index.js +71 -57
  76. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/index.js.map +1 -1
  77. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/linearRegression.js.map +1 -1
  78. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/isNumericScale.js +11 -0
  79. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/isNumericScale.js.map +1 -0
  80. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/ChartRenderer.js +10 -10
  81. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/ChartRenderer.js.map +1 -1
  82. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/SettingsImpl.js.map +1 -1
  83. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/components/LowerSVG.js +6 -6
  84. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/components/LowerSVG.js.map +1 -1
  85. package/dist/node_modules/@milaboratories/miplots4/dist/types/common.js +35 -25
  86. package/dist/node_modules/@milaboratories/miplots4/dist/types/common.js.map +1 -1
  87. package/dist/node_modules/@milaboratories/miplots4/dist/types/dendro.js +3 -3
  88. package/dist/node_modules/@milaboratories/miplots4/dist/types/discrete.js +37 -37
  89. package/dist/node_modules/@milaboratories/miplots4/dist/types/discrete.js.map +1 -1
  90. package/dist/node_modules/@milaboratories/miplots4/dist/types/heatmap.js +6 -6
  91. package/dist/node_modules/@milaboratories/miplots4/dist/types/scatterplot-umap.js +7 -7
  92. package/dist/node_modules/@milaboratories/miplots4/dist/types/scatterplot-umap.js.map +1 -1
  93. package/dist/node_modules/@milaboratories/miplots4/dist/utils/createMultilineDiscreteLabels.js +32 -0
  94. package/dist/node_modules/@milaboratories/miplots4/dist/utils/createMultilineDiscreteLabels.js.map +1 -0
  95. package/dist/node_modules/@milaboratories/miplots4/dist/utils/getFacetRowsColumns.js +18 -0
  96. package/dist/node_modules/@milaboratories/miplots4/dist/utils/getFacetRowsColumns.js.map +1 -0
  97. package/dist/node_modules/@milaboratories/miplots4/dist/utils/measureMultilineDiscreteLabels.js +63 -0
  98. package/dist/node_modules/@milaboratories/miplots4/dist/utils/measureMultilineDiscreteLabels.js.map +1 -0
  99. package/dist/node_modules/@milaboratories/miplots4/dist/{discrete/utils → utils}/splitTextByWidth.js +1 -1
  100. package/dist/node_modules/@milaboratories/miplots4/dist/utils/splitTextByWidth.js.map +1 -0
  101. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ComponentController.js +39 -32
  102. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ComponentController.js.map +1 -1
  103. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ControllerBase.js +68 -62
  104. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ControllerBase.js.map +1 -1
  105. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/dendro.js +5 -5
  106. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/histogram.js +8 -8
  107. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot-umap.js +3 -3
  108. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot.js +8 -8
  109. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot.js.map +1 -1
  110. package/dist/node_modules/@milaboratories/pf-plots/dist/index.js +12 -9
  111. package/dist/node_modules/@milaboratories/pf-plots/dist/index.js.map +1 -1
  112. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-error-like/dist/{index.js → error_like_shape.js} +1 -1
  113. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-error-like/dist/error_like_shape.js.map +1 -0
  114. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/drivers/blob.js +8 -0
  115. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/drivers/blob.js.map +1 -0
  116. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/data_types.js +63 -0
  117. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/data_types.js.map +1 -0
  118. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/linker_columns.js +152 -0
  119. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/linker_columns.js.map +1 -0
  120. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/spec.js +189 -0
  121. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/spec.js.map +1 -0
  122. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/errors.js +18 -0
  123. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/errors.js.map +1 -0
  124. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/json.js +12 -0
  125. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/json.js.map +1 -0
  126. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/plid.js +7 -0
  127. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/plid.js.map +1 -0
  128. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/ref.js +8 -0
  129. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/ref.js.map +1 -0
  130. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/dist/components/PlDataTable.js +13 -0
  131. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/dist/components/PlDataTable.js.map +1 -0
  132. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/dist/render/util/label.js +89 -0
  133. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/dist/render/util/label.js.map +1 -0
  134. package/dist/node_modules/@milaboratories/pf-plots/dist/pframe/ColumnsProvider.js +50 -45
  135. package/dist/node_modules/@milaboratories/pf-plots/dist/pframe/ColumnsProvider.js.map +1 -1
  136. package/dist/node_modules/@milaboratories/pf-plots/dist/utils.js +54 -50
  137. package/dist/node_modules/@milaboratories/pf-plots/dist/utils.js.map +1 -1
  138. package/package.json +4 -4
  139. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/components/BandAxis.js.map +0 -1
  140. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/utils/splitTextByWidth.js.map +0 -1
  141. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/Axis.js +0 -59
  142. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/Axis.js.map +0 -1
  143. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-error-like/dist/index.js.map +0 -1
  144. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/index.js +0 -979
  145. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/index.js.map +0 -1
  146. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/dist/index.js +0 -1599
  147. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/dist/index.js.map +0 -1
@@ -4,7 +4,7 @@ import { FORMAT as T } from "../../constants.js";
4
4
  import { ControllerBase as V } from "../ControllerBase.js";
5
5
  import { ComponentController as p } from "../ComponentController.js";
6
6
  import { columnOrAxisIdFromString as u, AxisId as N, isColumnId as b } from "../../spec.js";
7
- import { checkSourceBySpecForFilters as k, createLinkerMap as X, getFiltersFromStates as Y, getAxesSpecsFromSources as H, getLinkerColumnsForSource as z, getColumnOrAxisValueLabelsId as D, createHighlightColumn as J, getColumnOrAxisLabel as I, getColumnOrAxisSpec as E } from "../../utils.js";
7
+ import { checkSourceBySpecForFilters as k, createLinkerMap as X, getFiltersFromStates as Y, getAxesSpecsFromSources as H, getLinkerColumnsForSource as $, getColumnOrAxisValueLabelsId as D, createHighlightColumn as J, getColumnOrAxisLabel as I, getColumnOrAxisSpec as z } from "../../utils.js";
8
8
  var Q = Object.defineProperty, R = (h, t, e) => t in h ? Q(h, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[t] = e, U = (h, t, e) => R(h, t + "", e);
9
9
  const oe = {
10
10
  type: "scatterplot",
@@ -29,7 +29,7 @@ class ne extends V {
29
29
  {
30
30
  x: new p({
31
31
  componentName: "x",
32
- allowedTypes: ["Int", "Long", "Double", "Float"],
32
+ allowedTypes: ["Int", "Long", "Double", "Float", "String"],
33
33
  parentComponents: ["y"],
34
34
  strictlyDependsOnParents: !1,
35
35
  settings: {
@@ -41,7 +41,7 @@ class ne extends V {
41
41
  }),
42
42
  y: new p({
43
43
  componentName: "y",
44
- allowedTypes: ["Int", "Long", "Double", "Float"],
44
+ allowedTypes: ["Int", "Long", "Double", "Float", "String"],
45
45
  parentComponents: ["x"],
46
46
  strictlyDependsOnParents: !1,
47
47
  settings: {
@@ -187,7 +187,7 @@ class ne extends V {
187
187
  throw Error("One of X and Y should be a column");
188
188
  const L = await H(t, A), F = [r, i, ...P], f = [], B = [[], []], O = [], v = [];
189
189
  for (const { selectedSource: s, fixedAxes: a } of n)
190
- v.push(...await z(
190
+ v.push(...await $(
191
191
  t,
192
192
  y,
193
193
  L,
@@ -208,8 +208,8 @@ class ne extends V {
208
208
  for (const s of o)
209
209
  for (const { selectedSource: a, fixedAxes: C } of s.selectorStates) {
210
210
  f.push(u(a)), O.push(
211
- (C ?? []).map(({ axisIdx: $, axisValue: q }) => ({ idx: $, value: q }))
212
- ), v.push(...await z(
211
+ (C ?? []).map(({ axisIdx: E, axisValue: q }) => ({ idx: E, value: q }))
212
+ ), v.push(...await $(
213
213
  t,
214
214
  y,
215
215
  L,
@@ -275,7 +275,7 @@ class ne extends V {
275
275
  ), B = await Promise.all(
276
276
  e.components.tooltipContent.selectorStates.map(async (o) => {
277
277
  var l;
278
- const s = o.selectedSource, a = u(s), C = await D(t, s, n) ?? a, x = await E(t, s, n);
278
+ const s = o.selectedSource, a = u(s), C = await D(t, s, n) ?? a, x = await z(t, s, n);
279
279
  return {
280
280
  type: "column",
281
281
  label: await I(t, s, n) || s,
@@ -287,7 +287,7 @@ class ne extends V {
287
287
  );
288
288
  let O;
289
289
  if (e.components.label.selectorStates.length) {
290
- const o = e.components.label.selectorStates[0].selectedSource, l = await E(t, o, n);
290
+ const o = e.components.label.selectorStates[0].selectedSource, l = await z(t, o, n);
291
291
  O = {
292
292
  type: "column",
293
293
  value: o,
@@ -1 +1 @@
1
- {"version":3,"file":"scatterplot.js","sources":["../../../../../../../node_modules/@milaboratories/pf-plots/src/controllers/controllersByChartType/scatterplot.ts"],"sourcesContent":["import canonicalize from 'canonicalize';\nimport lodash from 'lodash';\nimport type {\n ComponentStateFilter,\n ComponentStateSimple,\n DataByColumns,\n InputStateParent,\n} from '../../common';\nimport {FORMAT} from '../../constants';\nimport {PValue} from '../../store';\nimport {ControllerBase, PlotDataAndSettings} from '../ControllerBase';\nimport {ComponentController} from '../ComponentController';\nimport {AxisId, ColumnId} from '../../spec';\nimport {columnOrAxisIdFromString, isColumnId} from '../../spec';\nimport type {DataStore} from '../../store';\nimport {\n checkSourceBySpecForFilters,\n createHighlightColumn,\n createLinkerMap,\n getAxesSpecsFromSources,\n getColumnOrAxisLabel, getColumnOrAxisSpec,\n getColumnOrAxisValueLabelsId,\n getFiltersFromStates,\n getLinkerColumnsForSource,\n} from '../../utils';\n\nexport interface ScatterplotUIState extends InputStateParent<'scatterplot'> {\n type: 'scatterplot';\n components: {\n x: ComponentStateSimple;\n y: ComponentStateSimple;\n filters: ComponentStateFilter;\n highlight: ComponentStateFilter;\n tabBy: ComponentStateFilter;\n facetBy: ComponentStateSimple;\n grouping: ComponentStateSimple;\n shape: ComponentStateSimple;\n size: ComponentStateSimple;\n label: ComponentStateSimple;\n tooltipContent: ComponentStateSimple;\n };\n}\n\nexport const InitialScatterplotState: ScatterplotUIState = {\n type: 'scatterplot',\n components: {\n x: {type: 'simple', selectorStates: []},\n y: {type: 'simple', selectorStates: []},\n filters: {type: 'filter', selectorStates: []},\n highlight: {type: 'filter', selectorStates: []},\n tabBy: {type: 'filter', selectorStates: []},\n facetBy: {type: 'simple', selectorStates: []},\n grouping: {type: 'simple', selectorStates: []},\n shape: {type: 'simple', selectorStates: []},\n size: {type: 'simple', selectorStates: []},\n label: {type: 'simple', selectorStates: []},\n tooltipContent: {type: 'simple', selectorStates: []}\n },\n dividedAxes: {},\n};\n\nexport class ScatterplotStateController extends ControllerBase<ScatterplotUIState> {\n dataInputs = ['x', 'y'];\n\n constructor() {\n super(\n {\n x: new ComponentController<ScatterplotUIState, 'x'>({\n componentName: 'x',\n allowedTypes: ['Int', 'Long', 'Double' , 'Float'],\n parentComponents: ['y'],\n strictlyDependsOnParents: false,\n settings: {\n isDataComponent: true,\n required: true,\n axesAllowed: true,\n columnsAllowed: true,\n },\n }),\n y: new ComponentController<ScatterplotUIState, 'y'>({\n componentName: 'y',\n allowedTypes: ['Int', 'Long', 'Double', 'Float'],\n parentComponents: ['x'],\n strictlyDependsOnParents: false,\n settings: {\n isDataComponent: true,\n required: true,\n axesAllowed: true,\n columnsAllowed: true,\n },\n }),\n facetBy: new ComponentController<ScatterplotUIState, 'facetBy'>({\n componentName: 'facetBy',\n allowedTypes: ['String', 'Int', 'Long'],\n strictlyDependsOnParents: true,\n parentComponents: ['x', 'y'],\n dependsOn: ['x', 'y'],\n settings: {\n axesAllowed: true,\n dimensionConsumer: true,\n multipleSelectors: true,\n },\n }),\n grouping: new ComponentController<ScatterplotUIState, 'grouping'>({\n componentName: 'grouping',\n allowedTypes: ['String', 'Int', 'Long', 'Double', 'Float'],\n strictlyDependsOnParents: true,\n parentComponents: ['x', 'y'],\n dependsOn: ['x', 'y'],\n settings: {\n axesAllowed: true,\n multipleSelectors: true,\n },\n }),\n shape: new ComponentController<ScatterplotUIState, 'shape'>({\n componentName: 'shape',\n allowedTypes: ['String', 'Int', 'Long'],\n strictlyDependsOnParents: true,\n parentComponents: ['x', 'y'],\n dependsOn: ['x', 'y'],\n settings: {\n axesAllowed: true,\n },\n }),\n size: new ComponentController<ScatterplotUIState, 'size'>({\n componentName: 'size',\n allowedTypes: ['Int', 'Long', 'Double', 'Float'],\n strictlyDependsOnParents: true,\n parentComponents: ['x', 'y'],\n dependsOn: ['x', 'y'],\n settings: {\n axesAllowed: true,\n },\n }),\n tooltipContent: new ComponentController<ScatterplotUIState, 'tooltipContent'>({\n componentName: 'tooltipContent',\n allowedTypes: ['String', 'Int', 'Long', 'Float', 'Double'],\n strictlyDependsOnParents: true,\n parentComponents: ['x', 'y'],\n dependsOn: ['x', 'y'],\n settings: {\n columnsAllowed: true,\n axesAllowed: true,\n multipleSelectors: true,\n },\n }),\n label: new ComponentController<ScatterplotUIState, 'label'>({\n componentName: 'label',\n allowedTypes: ['String', 'Int', 'Long'],\n strictlyDependsOnParents: true,\n parentComponents: ['x', 'y'],\n dependsOn: ['x', 'y'],\n settings: {\n axesAllowed: true,\n columnsAllowed: true,\n multipleSelectors: false,\n },\n }),\n },\n {\n filters: new ComponentController<ScatterplotUIState, 'filters'>({\n componentName: 'filters',\n allowedTypes: ['String', 'Int', 'Long', 'Double', 'Float'],\n strictlyDependsOnParents: true,\n parentComponents: ['x', 'y'],\n dependsOn: ['x', 'y'],\n settings: {\n axesAllowed: true,\n columnsAllowed: true,\n dimensionConsumer: true,\n multipleSelectors: true,\n },\n checkSourceBySpec: checkSourceBySpecForFilters\n }),\n tabBy: new ComponentController<ScatterplotUIState, 'tabBy'>({\n componentName: 'tabBy',\n allowedTypes: ['String', 'Int'],\n strictlyDependsOnParents: true,\n parentComponents: ['x', 'y'],\n dependsOn: ['x', 'y'],\n settings: {\n axesAllowed: true,\n dimensionConsumer: true,\n },\n }),\n highlight: new ComponentController<ScatterplotUIState, 'highlight'>({\n componentName: 'highlight',\n allowedTypes: ['String', 'Int', 'Long', 'Double', 'Float'],\n strictlyDependsOnParents: true,\n parentComponents: ['x', 'y'],\n dependsOn: ['x', 'y'],\n settings: {\n axesAllowed: true,\n columnsAllowed: true,\n multipleSelectors: true,\n },\n checkSourceBySpec: checkSourceBySpecForFilters\n }),\n }\n );\n }\n\n async getMustBeConsumedAxes(store: DataStore, state: ScatterplotUIState):Promise<Set<string>> {\n if (!state.components.x.selectorStates.length || !state.components.y.selectorStates.length) {\n return new Set<string>();\n }\n const sourceIdX = state.components.x.selectorStates[0].selectedSource;\n const sourceIdY = state.components.y.selectorStates[0].selectedSource;\n const specX = await store.pFrameProvider.getColumnSpecById(columnOrAxisIdFromString(sourceIdX));\n const specY = await store.pFrameProvider.getColumnSpecById(columnOrAxisIdFromString(sourceIdY));\n if (!specX || !specY) {\n return new Set<string>();\n }\n const axesX = specX.axesSpec.map((s) => AxisId.fromAxisSpec(s).toCanonicalString());\n const axesY = specY.axesSpec.map((s) => AxisId.fromAxisSpec(s).toCanonicalString());\n const hangingX = axesX.filter(axisKey => !axesY.some(id => id === axisKey));\n const hangingY = axesY.filter(axisKey => !axesX.some(id => id === axisKey));\n\n return new Set<string>([...hangingX, ...hangingY])\n }\n\n async createDataByColumns(store: DataStore, state: ScatterplotUIState): Promise<PlotDataAndSettings['data']> {\n const xColumnIdString = state.components.x.selectorStates[0]?.selectedSource;\n const yColumnIdString = state.components.y.selectorStates[0]?.selectedSource;\n if (!xColumnIdString || !yColumnIdString) {\n throw Error('X or Y column is not valid');\n }\n const xId = columnOrAxisIdFromString(xColumnIdString);\n const yId = columnOrAxisIdFromString(yColumnIdString);\n const dataByColumns: DataByColumns = {\n type: 'columns',\n id: canonicalize(state.components) ?? '',\n values: {},\n };\n\n const linkerMap = await createLinkerMap(store);\n\n const filterSelectedStates = [\n ...state.components.filters.selectorStates,\n ...state.components.tabBy.selectorStates\n ]\n // filters for column/axes data requests\n const filters = getFiltersFromStates(filterSelectedStates);\n const filterColumns = filterSelectedStates.map(s => columnOrAxisIdFromString(s.selectedSource)).filter(isColumnId);\n\n const parentSources = [xId, yId].filter(isColumnId).map(item => item.toCanonicalString());\n\n if (parentSources.length === 0) {\n throw Error('One of X and Y should be a column');\n }\n const parentAxesList = await getAxesSpecsFromSources(store, parentSources);\n\n const primarySources = [xId, yId, ...filterColumns];\n const secondarySources: (ColumnId | AxisId)[] = [];\n const primarySourcesFixedAxes:{idx: number, value: PValue}[][] = [[], []];\n const secondarySourcesFixedAxes:{idx: number, value: PValue}[][] = [];\n const linkerColumns:ColumnId[] = [];\n\n for (const {selectedSource, fixedAxes} of filterSelectedStates) {\n linkerColumns.push(...await getLinkerColumnsForSource(\n store,\n linkerMap,\n parentAxesList,\n selectedSource,\n fixedAxes\n ));\n primarySourcesFixedAxes.push(\n (fixedAxes ?? []).map(({axisIdx, axisValue}) => ({idx: axisIdx, value: axisValue as PValue}))\n );\n }\n\n const inputs = [\n state.components.grouping,\n state.components.size,\n state.components.shape,\n state.components.tooltipContent,\n state.components.facetBy,\n state.components.label,\n state.components.highlight,\n ];\n for (const input of inputs) {\n for (const {selectedSource, fixedAxes} of input.selectorStates) {\n secondarySources.push(columnOrAxisIdFromString(selectedSource)!);\n secondarySourcesFixedAxes.push(\n (fixedAxes ?? []).map(({axisIdx, axisValue}) => ({idx: axisIdx, value: axisValue as PValue}))\n );\n linkerColumns.push(...await getLinkerColumnsForSource(\n store,\n linkerMap,\n parentAxesList,\n selectedSource,\n fixedAxes\n ));\n const labelsColumnId = await getColumnOrAxisValueLabelsId(store, selectedSource, parentSources);\n if (labelsColumnId) {\n secondarySources.push(labelsColumnId);\n }\n }\n }\n\n const data = await store.pFrameProvider.getTableOuterJoin(\n [xId, yId, ...linkerColumns, ...filterColumns],\n secondarySources,\n filters,\n false,\n primarySourcesFixedAxes,\n secondarySourcesFixedAxes\n );\n\n [...primarySources, ...secondarySources].forEach(item => {\n const key = item.toCanonicalString();\n dataByColumns.values[key] = isColumnId(item) ? data.columnsData[key] : data.axesData[key];\n });\n\n dataByColumns.values['key'] = new Array(dataByColumns.values[Object.keys(dataByColumns.values)[0]].length).fill(0).map((_v, idx) => idx);\n\n if (state.components.highlight.selectorStates.length) {\n dataByColumns.values['highlight'] = createHighlightColumn(state.components.highlight.selectorStates, data) as PValue[];\n }\n\n return {byColumns: dataByColumns};\n }\n\n async createChartSettings(store: DataStore, state: ScatterplotUIState): Promise<Record<string, unknown>> {\n const xIdString = state.components.x.selectorStates[0]?.selectedSource;\n const yIdString = state.components.y.selectorStates[0]?.selectedSource;\n const xIdWithQ = xIdString ? columnOrAxisIdFromString(xIdString) : null;\n const yIdWithQ = yIdString ? columnOrAxisIdFromString(yIdString) : null;\n if (!xIdString || !yIdString || !xIdWithQ || !yIdWithQ || (!isColumnId(xIdWithQ) && !isColumnId(yIdWithQ))) {\n throw Error('Empty or invalid required data');\n }\n\n const parentSources = [xIdWithQ, yIdWithQ].filter(isColumnId).map(item => item.toCanonicalString());\n const x = {\n type: 'column',\n value: xIdString,\n label: await getColumnOrAxisLabel(store, xIdString, parentSources),\n };\n const y = {\n type: 'column',\n value: yIdString,\n label: await getColumnOrAxisLabel(store, yIdString, parentSources),\n };\n const keyColumn = {\n type: 'column',\n value: 'key',\n };\n const facetBy = await Promise.all(\n state.components.facetBy.selectorStates.map(async selectorState => ({\n type: 'column',\n value:\n (await getColumnOrAxisValueLabelsId(store, selectorState.selectedSource, parentSources))?.toCanonicalString() ??\n selectorState.selectedSource,\n }))\n );\n const allGroupingIds = lodash.uniq([\n ...state.components.grouping.selectorStates.map(s => s.selectedSource),\n ...state.components.size.selectorStates.map(s => s.selectedSource),\n ...state.components.shape.selectorStates.map(s => s.selectedSource),\n ]);\n const grouping = await Promise.all(\n allGroupingIds.map(async idString => {\n return {\n columnName: {\n type: 'column',\n label: (await getColumnOrAxisLabel(store, idString, parentSources)) || idString,\n value: idString,\n valueLabels:\n (await getColumnOrAxisValueLabelsId(store, idString, parentSources))?.toCanonicalString() ??\n idString,\n }\n };\n })\n );\n\n const tooltipContent = await Promise.all(\n state.components.tooltipContent.selectorStates.map(async selectorState => {\n const source = selectorState.selectedSource;\n const id = columnOrAxisIdFromString(source);\n const labelColumn = (await getColumnOrAxisValueLabelsId(store, source, parentSources)) ?? id;\n const spec = await getColumnOrAxisSpec(store, source, parentSources);\n return {\n type: 'column',\n label: (await getColumnOrAxisLabel(store, source, parentSources)) || source,\n value: source,\n valueLabels: labelColumn.toCanonicalString(),\n format: spec?.annotations?.[FORMAT]\n };\n })\n );\n\n let label;\n if (state.components.label.selectorStates.length) {\n const source = state.components.label.selectorStates[0].selectedSource;\n const spec = await getColumnOrAxisSpec(store, source, parentSources);\n label = {\n type: 'column',\n value: source,\n label: await getColumnOrAxisLabel(store, source, parentSources),\n valueLabels:\n (await getColumnOrAxisValueLabelsId(store, source, parentSources))?.toCanonicalString() ??\n source,\n format: spec?.annotations?.[FORMAT]\n };\n }\n let highlight;\n if (state.components.highlight.selectorStates.length) {\n highlight = {\n type: 'column',\n value: 'highlight'\n }\n }\n return {\n type: 'scatterplot',\n x,\n y,\n keyColumn,\n facetBy,\n grouping,\n label,\n highlight,\n tooltips: {\n show: true,\n content: tooltipContent\n }\n };\n }\n}\n"],"names":["InitialScatterplotState","ScatterplotStateController","ControllerBase","ComponentController","checkSourceBySpecForFilters","__publicField","store","state","sourceIdX","sourceIdY","specX","columnOrAxisIdFromString","specY","axesX","s","AxisId","axesY","hangingX","axisKey","id","hangingY","xColumnIdString","_a","yColumnIdString","_b","xId","yId","dataByColumns","canonicalize","linkerMap","createLinkerMap","filterSelectedStates","filters","getFiltersFromStates","filterColumns","isColumnId","parentSources","item","parentAxesList","getAxesSpecsFromSources","primarySources","secondarySources","primarySourcesFixedAxes","secondarySourcesFixedAxes","linkerColumns","selectedSource","fixedAxes","getLinkerColumnsForSource","axisIdx","axisValue","inputs","input","labelsColumnId","getColumnOrAxisValueLabelsId","data","key","_v","idx","createHighlightColumn","xIdString","yIdString","xIdWithQ","yIdWithQ","x","getColumnOrAxisLabel","y","keyColumn","facetBy","selectorState","allGroupingIds","lodash","grouping","idString","tooltipContent","source","labelColumn","spec","getColumnOrAxisSpec","FORMAT","label","_c","_d","highlight"],"mappings":";;;;;;;;AA2CO,MAAMA,KAA8C;AAAA,EACvD,MAAM;AAAA,EACN,YAAY;AAAA,IACR,GAAG,EAAC,MAAM,UAAU,gBAAgB,CAAA,EAAA;AAAA,IACpC,GAAG,EAAC,MAAM,UAAU,gBAAgB,CAAA,EAAA;AAAA,IACpC,SAAS,EAAC,MAAM,UAAU,gBAAgB,CAAA,EAAA;AAAA,IAC1C,WAAW,EAAC,MAAM,UAAU,gBAAgB,CAAA,E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AA;AAAAA,QAAA;AAAA,MAEnC,CAAA;AAAA,IAAA;AAGD,QAAAC;AACJ,QAAIxE,EAAM,WAAW,MAAM,eAAe,QAAQ;AAC9C,YAAMmE,IAAUnE,EAAM,WAAW,MAAM,eAAe,CAAC,EAAE,gBACnDqE,IAAO,MAAMC,EAAoBvE,GAAOoE,GAAQtC,CAAa;AAC3D2C,MAAAA,IAAA;AAAA,QACJ,MAAM;AAAA,QACN,OAAOL;AAAAA,QACP,OAAO,MAAMV,EAAqB1D,GAAOoE,GAAQtC,CAAa;AAAA,QAC9D,eACK4C,IAAA,MAAM3B,EAA6B/C,GAAOoE,GAAQtC,CAAa,MAA/D,OAAA,SAAA4C,EAAmE,kBAAA,MACpEN;AAAAA,QACJ,SAAQO,IAAAL,KAAA,gBAAAA,EAAM,gBAAN,gBAAAK,EAAoBH,CAAAA;AAAAA,MAAA;AAAA,IAChC;AAEA,QAAAI;AACJ,WAAI3E,EAAM,WAAW,UAAU,eAAe,WAC9B2E,IAAA;AAAA,MACR,MAAM;AAAA,MACN,OAAO;AAAA,IAAA,IAGR;AAAA,MACH,MAAM;AAAA,MACN,GAAAnB;AAAA,MACA,GAAAE;AAAAA,MACA,WAAAC;AAAAA,MACA,SAAAC;AAAAA,MACA,UAAAI;AAAAA,MACA,OAAAQ;AAAAA,MACA,WAAAG;AAAAA,MACA,UAAU;AAAA,QACN,MAAM;AAAA,QACN,SAAST;AAAAA,MAAA;AAAA,IAAA;AAAA,EAEjB;AAER;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"scatterplot.js","sources":["../../../../../../../node_modules/@milaboratories/pf-plots/src/controllers/controllersByChartType/scatterplot.ts"],"sourcesContent":["import canonicalize from 'canonicalize';\nimport lodash from 'lodash';\nimport type {\n ComponentStateFilter,\n ComponentStateSimple,\n DataByColumns,\n InputStateParent,\n} from '../../common';\nimport {FORMAT} from '../../constants';\nimport {PValue} from '../../store';\nimport {ControllerBase, PlotDataAndSettings} from '../ControllerBase';\nimport {ComponentController} from '../ComponentController';\nimport {AxisId, ColumnId} from '../../spec';\nimport {columnOrAxisIdFromString, isColumnId} from '../../spec';\nimport type {DataStore} from '../../store';\nimport {\n checkSourceBySpecForFilters,\n createHighlightColumn,\n createLinkerMap,\n getAxesSpecsFromSources,\n getColumnOrAxisLabel, getColumnOrAxisSpec,\n getColumnOrAxisValueLabelsId,\n getFiltersFromStates,\n getLinkerColumnsForSource,\n} from '../../utils';\n\nexport interface ScatterplotUIState extends InputStateParent<'scatterplot'> {\n type: 'scatterplot';\n components: {\n x: ComponentStateSimple;\n y: ComponentStateSimple;\n filters: ComponentStateFilter;\n highlight: ComponentStateFilter;\n tabBy: ComponentStateFilter;\n facetBy: ComponentStateSimple;\n grouping: ComponentStateSimple;\n shape: ComponentStateSimple;\n size: ComponentStateSimple;\n label: ComponentStateSimple;\n tooltipContent: ComponentStateSimple;\n };\n}\n\nexport const InitialScatterplotState: ScatterplotUIState = {\n type: 'scatterplot',\n components: {\n x: {type: 'simple', selectorStates: []},\n y: {type: 'simple', selectorStates: []},\n filters: {type: 'filter', selectorStates: []},\n highlight: {type: 'filter', selectorStates: []},\n tabBy: {type: 'filter', selectorStates: []},\n facetBy: {type: 'simple', selectorStates: []},\n grouping: {type: 'simple', selectorStates: []},\n shape: {type: 'simple', selectorStates: []},\n size: {type: 'simple', selectorStates: []},\n label: {type: 'simple', selectorStates: []},\n tooltipContent: {type: 'simple', selectorStates: []}\n },\n dividedAxes: {},\n};\n\nexport class ScatterplotStateController extends ControllerBase<ScatterplotUIState> {\n dataInputs = ['x', 'y'];\n\n constructor() {\n super(\n {\n x: new ComponentController<ScatterplotUIState, 'x'>({\n componentName: 'x',\n allowedTypes: ['Int', 'Long', 'Double' , 'Float', 'String'],\n parentComponents: ['y'],\n strictlyDependsOnParents: false,\n settings: {\n isDataComponent: true,\n required: true,\n axesAllowed: true,\n columnsAllowed: true,\n },\n }),\n y: new ComponentController<ScatterplotUIState, 'y'>({\n componentName: 'y',\n allowedTypes: ['Int', 'Long', 'Double', 'Float', 'String'],\n parentComponents: ['x'],\n strictlyDependsOnParents: false,\n settings: {\n isDataComponent: true,\n required: true,\n axesAllowed: true,\n columnsAllowed: true,\n },\n }),\n facetBy: new ComponentController<ScatterplotUIState, 'facetBy'>({\n componentName: 'facetBy',\n allowedTypes: ['String', 'Int', 'Long'],\n strictlyDependsOnParents: true,\n parentComponents: ['x', 'y'],\n dependsOn: ['x', 'y'],\n settings: {\n axesAllowed: true,\n dimensionConsumer: true,\n multipleSelectors: true,\n },\n }),\n grouping: new ComponentController<ScatterplotUIState, 'grouping'>({\n componentName: 'grouping',\n allowedTypes: ['String', 'Int', 'Long', 'Double', 'Float'],\n strictlyDependsOnParents: true,\n parentComponents: ['x', 'y'],\n dependsOn: ['x', 'y'],\n settings: {\n axesAllowed: true,\n multipleSelectors: true,\n },\n }),\n shape: new ComponentController<ScatterplotUIState, 'shape'>({\n componentName: 'shape',\n allowedTypes: ['String', 'Int', 'Long'],\n strictlyDependsOnParents: true,\n parentComponents: ['x', 'y'],\n dependsOn: ['x', 'y'],\n settings: {\n axesAllowed: true,\n },\n }),\n size: new ComponentController<ScatterplotUIState, 'size'>({\n componentName: 'size',\n allowedTypes: ['Int', 'Long', 'Double', 'Float'],\n strictlyDependsOnParents: true,\n parentComponents: ['x', 'y'],\n dependsOn: ['x', 'y'],\n settings: {\n axesAllowed: true,\n },\n }),\n tooltipContent: new ComponentController<ScatterplotUIState, 'tooltipContent'>({\n componentName: 'tooltipContent',\n allowedTypes: ['String', 'Int', 'Long', 'Float', 'Double'],\n strictlyDependsOnParents: true,\n parentComponents: ['x', 'y'],\n dependsOn: ['x', 'y'],\n settings: {\n columnsAllowed: true,\n axesAllowed: true,\n multipleSelectors: true,\n },\n }),\n label: new ComponentController<ScatterplotUIState, 'label'>({\n componentName: 'label',\n allowedTypes: ['String', 'Int', 'Long'],\n strictlyDependsOnParents: true,\n parentComponents: ['x', 'y'],\n dependsOn: ['x', 'y'],\n settings: {\n axesAllowed: true,\n columnsAllowed: true,\n multipleSelectors: false,\n },\n }),\n },\n {\n filters: new ComponentController<ScatterplotUIState, 'filters'>({\n componentName: 'filters',\n allowedTypes: ['String', 'Int', 'Long', 'Double', 'Float'],\n strictlyDependsOnParents: true,\n parentComponents: ['x', 'y'],\n dependsOn: ['x', 'y'],\n settings: {\n axesAllowed: true,\n columnsAllowed: true,\n dimensionConsumer: true,\n multipleSelectors: true,\n },\n checkSourceBySpec: checkSourceBySpecForFilters\n }),\n tabBy: new ComponentController<ScatterplotUIState, 'tabBy'>({\n componentName: 'tabBy',\n allowedTypes: ['String', 'Int'],\n strictlyDependsOnParents: true,\n parentComponents: ['x', 'y'],\n dependsOn: ['x', 'y'],\n settings: {\n axesAllowed: true,\n dimensionConsumer: true,\n },\n }),\n highlight: new ComponentController<ScatterplotUIState, 'highlight'>({\n componentName: 'highlight',\n allowedTypes: ['String', 'Int', 'Long', 'Double', 'Float'],\n strictlyDependsOnParents: true,\n parentComponents: ['x', 'y'],\n dependsOn: ['x', 'y'],\n settings: {\n axesAllowed: true,\n columnsAllowed: true,\n multipleSelectors: true,\n },\n checkSourceBySpec: checkSourceBySpecForFilters\n }),\n }\n );\n }\n\n async getMustBeConsumedAxes(store: DataStore, state: ScatterplotUIState):Promise<Set<string>> {\n if (!state.components.x.selectorStates.length || !state.components.y.selectorStates.length) {\n return new Set<string>();\n }\n const sourceIdX = state.components.x.selectorStates[0].selectedSource;\n const sourceIdY = state.components.y.selectorStates[0].selectedSource;\n const specX = await store.pFrameProvider.getColumnSpecById(columnOrAxisIdFromString(sourceIdX));\n const specY = await store.pFrameProvider.getColumnSpecById(columnOrAxisIdFromString(sourceIdY));\n if (!specX || !specY) {\n return new Set<string>();\n }\n const axesX = specX.axesSpec.map((s) => AxisId.fromAxisSpec(s).toCanonicalString());\n const axesY = specY.axesSpec.map((s) => AxisId.fromAxisSpec(s).toCanonicalString());\n const hangingX = axesX.filter(axisKey => !axesY.some(id => id === axisKey));\n const hangingY = axesY.filter(axisKey => !axesX.some(id => id === axisKey));\n\n return new Set<string>([...hangingX, ...hangingY])\n }\n\n async createDataByColumns(store: DataStore, state: ScatterplotUIState): Promise<PlotDataAndSettings['data']> {\n const xColumnIdString = state.components.x.selectorStates[0]?.selectedSource;\n const yColumnIdString = state.components.y.selectorStates[0]?.selectedSource;\n if (!xColumnIdString || !yColumnIdString) {\n throw Error('X or Y column is not valid');\n }\n const xId = columnOrAxisIdFromString(xColumnIdString);\n const yId = columnOrAxisIdFromString(yColumnIdString);\n const dataByColumns: DataByColumns = {\n type: 'columns',\n id: canonicalize(state.components) ?? '',\n values: {},\n };\n\n const linkerMap = await createLinkerMap(store);\n\n const filterSelectedStates = [\n ...state.components.filters.selectorStates,\n ...state.components.tabBy.selectorStates\n ]\n // filters for column/axes data requests\n const filters = getFiltersFromStates(filterSelectedStates);\n const filterColumns = filterSelectedStates.map(s => columnOrAxisIdFromString(s.selectedSource)).filter(isColumnId);\n\n const parentSources = [xId, yId].filter(isColumnId).map(item => item.toCanonicalString());\n\n if (parentSources.length === 0) {\n throw Error('One of X and Y should be a column');\n }\n const parentAxesList = await getAxesSpecsFromSources(store, parentSources);\n\n const primarySources = [xId, yId, ...filterColumns];\n const secondarySources: (ColumnId | AxisId)[] = [];\n const primarySourcesFixedAxes:{idx: number, value: PValue}[][] = [[], []];\n const secondarySourcesFixedAxes:{idx: number, value: PValue}[][] = [];\n const linkerColumns:ColumnId[] = [];\n\n for (const {selectedSource, fixedAxes} of filterSelectedStates) {\n linkerColumns.push(...await getLinkerColumnsForSource(\n store,\n linkerMap,\n parentAxesList,\n selectedSource,\n fixedAxes\n ));\n primarySourcesFixedAxes.push(\n (fixedAxes ?? []).map(({axisIdx, axisValue}) => ({idx: axisIdx, value: axisValue as PValue}))\n );\n }\n\n const inputs = [\n state.components.grouping,\n state.components.size,\n state.components.shape,\n state.components.tooltipContent,\n state.components.facetBy,\n state.components.label,\n state.components.highlight,\n ];\n for (const input of inputs) {\n for (const {selectedSource, fixedAxes} of input.selectorStates) {\n secondarySources.push(columnOrAxisIdFromString(selectedSource)!);\n secondarySourcesFixedAxes.push(\n (fixedAxes ?? []).map(({axisIdx, axisValue}) => ({idx: axisIdx, value: axisValue as PValue}))\n );\n linkerColumns.push(...await getLinkerColumnsForSource(\n store,\n linkerMap,\n parentAxesList,\n selectedSource,\n fixedAxes\n ));\n const labelsColumnId = await getColumnOrAxisValueLabelsId(store, selectedSource, parentSources);\n if (labelsColumnId) {\n secondarySources.push(labelsColumnId);\n }\n }\n }\n\n const data = await store.pFrameProvider.getTableOuterJoin(\n [xId, yId, ...linkerColumns, ...filterColumns],\n secondarySources,\n filters,\n false,\n primarySourcesFixedAxes,\n secondarySourcesFixedAxes\n );\n\n [...primarySources, ...secondarySources].forEach(item => {\n const key = item.toCanonicalString();\n dataByColumns.values[key] = isColumnId(item) ? data.columnsData[key] : data.axesData[key];\n });\n\n dataByColumns.values['key'] = new Array(dataByColumns.values[Object.keys(dataByColumns.values)[0]].length).fill(0).map((_v, idx) => idx);\n\n if (state.components.highlight.selectorStates.length) {\n dataByColumns.values['highlight'] = createHighlightColumn(state.components.highlight.selectorStates, data) as PValue[];\n }\n\n return {byColumns: dataByColumns};\n }\n\n async createChartSettings(store: DataStore, state: ScatterplotUIState): Promise<Record<string, unknown>> {\n const xIdString = state.components.x.selectorStates[0]?.selectedSource;\n const yIdString = state.components.y.selectorStates[0]?.selectedSource;\n const xIdWithQ = xIdString ? columnOrAxisIdFromString(xIdString) : null;\n const yIdWithQ = yIdString ? columnOrAxisIdFromString(yIdString) : null;\n if (!xIdString || !yIdString || !xIdWithQ || !yIdWithQ || (!isColumnId(xIdWithQ) && !isColumnId(yIdWithQ))) {\n throw Error('Empty or invalid required data');\n }\n\n const parentSources = [xIdWithQ, yIdWithQ].filter(isColumnId).map(item => item.toCanonicalString());\n const x = {\n type: 'column',\n value: xIdString,\n label: await getColumnOrAxisLabel(store, xIdString, parentSources),\n };\n const y = {\n type: 'column',\n value: yIdString,\n label: await getColumnOrAxisLabel(store, yIdString, parentSources),\n };\n const keyColumn = {\n type: 'column',\n value: 'key',\n };\n const facetBy = await Promise.all(\n state.components.facetBy.selectorStates.map(async selectorState => ({\n type: 'column',\n value:\n (await getColumnOrAxisValueLabelsId(store, selectorState.selectedSource, parentSources))?.toCanonicalString() ??\n selectorState.selectedSource,\n }))\n );\n const allGroupingIds = lodash.uniq([\n ...state.components.grouping.selectorStates.map(s => s.selectedSource),\n ...state.components.size.selectorStates.map(s => s.selectedSource),\n ...state.components.shape.selectorStates.map(s => s.selectedSource),\n ]);\n const grouping = await Promise.all(\n allGroupingIds.map(async idString => {\n return {\n columnName: {\n type: 'column',\n label: (await getColumnOrAxisLabel(store, idString, parentSources)) || idString,\n value: idString,\n valueLabels:\n (await getColumnOrAxisValueLabelsId(store, idString, parentSources))?.toCanonicalString() ??\n idString,\n }\n };\n })\n );\n\n const tooltipContent = await Promise.all(\n state.components.tooltipContent.selectorStates.map(async selectorState => {\n const source = selectorState.selectedSource;\n const id = columnOrAxisIdFromString(source);\n const labelColumn = (await getColumnOrAxisValueLabelsId(store, source, parentSources)) ?? id;\n const spec = await getColumnOrAxisSpec(store, source, parentSources);\n return {\n type: 'column',\n label: (await getColumnOrAxisLabel(store, source, parentSources)) || source,\n value: source,\n valueLabels: labelColumn.toCanonicalString(),\n format: spec?.annotations?.[FORMAT]\n };\n })\n );\n\n let label;\n if (state.components.label.selectorStates.length) {\n const source = state.components.label.selectorStates[0].selectedSource;\n const spec = await getColumnOrAxisSpec(store, source, parentSources);\n label = {\n type: 'column',\n value: source,\n label: await getColumnOrAxisLabel(store, source, parentSources),\n valueLabels:\n (await getColumnOrAxisValueLabelsId(store, source, parentSources))?.toCanonicalString() ??\n source,\n format: spec?.annotations?.[FORMAT]\n };\n }\n let highlight;\n if (state.components.highlight.selectorStates.length) {\n highlight = {\n type: 'column',\n value: 'highlight'\n }\n }\n return {\n type: 'scatterplot',\n x,\n y,\n keyColumn,\n facetBy,\n grouping,\n label,\n highlight,\n tooltips: {\n show: true,\n content: tooltipContent\n }\n };\n }\n}\n"],"names":["InitialScatterplotState","ScatterplotStateController","ControllerBase","ComponentController","checkSourceBySpecForFilters","__publicField","store","state","sourceIdX","sourceIdY","specX","columnOrAxisIdFromString","specY","axesX","s","AxisId","axesY","hangingX","axisKey","id","hangingY","xColumnIdString","_a","yColumnIdString","_b","xId","yId","dataByColumns","canonicalize","linkerMap","createLinkerMap","filterSelectedStates","filters","getFiltersFromStates","filterColumns","isColumnId","parentSources","item","parentAxesList","getAxesSpecsFromSources","primarySources","secondarySources","primarySourcesFixedAxes","secondarySourcesFixedAxes","linkerColumns","selectedSource","fixedAxes","getLinkerColumnsForSource","axisIdx","axisValue","inputs","input","labelsColumnId","getColumnOrAxisValueLabelsId","data","key","_v","idx","createHighlightColumn","xIdString","yIdString","xIdWithQ","yIdWithQ","x","getColumnOrAxisLabel","y","keyColumn","facetBy","selectorState","allGroupingIds","lodash","grouping","idString","tooltipContent","source","labelColumn","spec","getColumnOrAxisSpec","FORMAT","label","_c","_d","highlight"],"mappings":";;;;;;;;AA2CO,MAAMA,KAA8C;AAAA,EACvD,MAAM;AAAA,EACN,YAAY;AAAA,IACR,GAAG,EAAC,MAAM,UAAU,gBAAgB,CAAA,EAAA;AAAA,IACpC,GAAG,EAAC,MAAM,UAAU,gBAAgB,CAAA,EAAA;AAAA,IACpC,SAAS,EAAC,MAAM,UAAU,gBAAgB,CAAA,EAAA;AAAA,IAC1C,WAAW,EAAC,MAAM,UAAU,gBAAgB,CAAA,EAAA;AAAA,IAC5C,OAAO,EAAC,MAAM,UAAU,gBAAgB,CAAA,EAAA;AAAA,IACxC,SAAS,EAAC,MAAM,UAAU,gBAAgB,CAAA,EAAA;AAAA,IAC1C,UAAU,EAAC,MAAM,UAAU,gBAAgB,CAAA,EAAA;AAAA,IAC3C,OAAO,EAAC,MAAM,UAAU,gBAAgB,CAAA,EAAA;AAAA,IACxC,MAAM,EAAC,MAAM,UAAU,gBAAgB,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AAA,QACN,OAAOL;AAAAA,QACP,OAAO,MAAMV,EAAqB1D,GAAOoE,GAAQtC,CAAa;AAAA,QAC9D,eACK4C,IAAA,MAAM3B,EAA6B/C,GAAOoE,GAAQtC,CAAa,MAA/D,OAAA,SAAA4C,EAAmE,kBAAA,MACpEN;AAAAA,QACJ,SAAQO,IAAAL,KAAA,gBAAAA,EAAM,gBAAN,gBAAAK,EAAoBH,CAAAA;AAAAA,MAAA;AAAA,IAChC;AAEA,QAAAI;AACJ,WAAI3E,EAAM,WAAW,UAAU,eAAe,WAC9B2E,IAAA;AAAA,MACR,MAAM;AAAA,MACN,OAAO;AAAA,IAAA,IAGR;AAAA,MACH,MAAM;AAAA,MACN,GAAAnB;AAAA,MACA,GAAAE;AAAAA,MACA,WAAAC;AAAAA,MACA,SAAAC;AAAAA,MACA,UAAAI;AAAAA,MACA,OAAAQ;AAAAA,MACA,WAAAG;AAAAA,MACA,UAAU;AAAA,QACN,MAAM;AAAA,QACN,SAAST;AAAAA,MAAA;AAAA,IAAA;AAAA,EAEjB;AAER;","x_google_ignoreList":[0]}
@@ -1,16 +1,19 @@
1
1
  import { BubbleStateController as a, InitialBubbleState as r } from "./controllers/controllersByChartType/bubble.js";
2
2
  import { DendroStateController as o, InitialDendroState as l } from "./controllers/controllersByChartType/dendro.js";
3
- import { DiscreteStateController as n, InitialDiscreteState as i } from "./controllers/controllersByChartType/discrete.js";
3
+ import { DiscreteStateController as i, InitialDiscreteState as n } from "./controllers/controllersByChartType/discrete.js";
4
4
  import { HeatmapStateController as s, InitialHeatmapState as p } from "./controllers/controllersByChartType/heatmap.js";
5
5
  import { HistogramStateController as m, InitialHistogramState as S } from "./controllers/controllersByChartType/histogram.js";
6
6
  import { ScatterplotStateController as c, InitialScatterplotState as C } from "./controllers/controllersByChartType/scatterplot.js";
7
7
  import { ScatterplotUmapStateController as b, InitialScatterplotUmapState as u } from "./controllers/controllersByChartType/scatterplot-umap.js";
8
8
  import "./_virtual/canonicalize.js";
9
9
  import "./_virtual/lodash.js";
10
- import "./node_modules/@milaboratories/pl-model-common/dist/index.js";
10
+ import "./node_modules/@milaboratories/pl-model-common/dist/drivers/blob.js";
11
+ import "./node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/spec.js";
12
+ import "./node_modules/@milaboratories/pl-model-common/dist/plid.js";
13
+ import "./node_modules/@milaboratories/pl-model-common/dist/ref.js";
11
14
  const e = {
12
15
  controllers: {
13
- discrete: new n(),
16
+ discrete: new i(),
14
17
  scatterplot: new c(),
15
18
  "scatterplot-umap": new b(),
16
19
  heatmap: new s(),
@@ -19,7 +22,7 @@ const e = {
19
22
  bubble: new a()
20
23
  },
21
24
  initialStates: {
22
- discrete: i,
25
+ discrete: n,
23
26
  scatterplot: C,
24
27
  "scatterplot-umap": u,
25
28
  heatmap: p,
@@ -28,19 +31,19 @@ const e = {
28
31
  bubble: r
29
32
  }
30
33
  };
31
- function U(t) {
34
+ function j(t) {
32
35
  return e.controllers[t];
33
36
  }
34
- function $(t) {
37
+ function q(t) {
35
38
  return e.initialStates[t];
36
39
  }
37
40
  export {
38
41
  a as BubbleStateController,
39
42
  o as DendroStateController,
40
- n as DiscreteStateController,
43
+ i as DiscreteStateController,
41
44
  s as HeatmapStateController,
42
45
  c as ScatterplotStateController,
43
- U as getControllerByType,
44
- $ as getInitialStateByType
46
+ j as getControllerByType,
47
+ q as getInitialStateByType
45
48
  };
46
49
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../node_modules/@milaboratories/pf-plots/src/index.ts"],"sourcesContent":["import type {\n AxisData,\n ChartType,\n ColumnData,\n ColumnOrAxisData,\n ComponentGuideFilter,\n ComponentGuideSimple,\n ComponentStateFilter,\n ComponentStateSimple,\n InputGuide,\n InputState,\n InputStateParent,\n SelectorStateFilter,\n SelectorStateSimple,\n SourceOption,\n} from './common';\nimport type { Controller, PlotDataAndSettings } from './controllers/ControllerBase';\nimport { BubbleStateController, BubbleUIState, InitialBubbleState } from './controllers/controllersByChartType/bubble';\nimport type { DendroUIState } from './controllers/controllersByChartType/dendro';\nimport { DendroStateController, InitialDendroState } from './controllers/controllersByChartType/dendro';\nimport type { DiscreteUIState } from './controllers/controllersByChartType/discrete';\nimport { DiscreteStateController, InitialDiscreteState } from './controllers/controllersByChartType/discrete';\nimport type { HeatmapUIState } from './controllers/controllersByChartType/heatmap';\nimport { HeatmapStateController, InitialHeatmapState } from './controllers/controllersByChartType/heatmap';\nimport {\n HistogramStateController,\n HistogramUIState,\n InitialHistogramState,\n} from './controllers/controllersByChartType/histogram';\nimport type { ScatterplotUIState } from './controllers/controllersByChartType/scatterplot';\nimport { InitialScatterplotState, ScatterplotStateController } from './controllers/controllersByChartType/scatterplot';\nimport {\n InitialScatterplotUmapState,\n ScatterplotUmapStateController,\n ScatterplotUmapUIState,\n} from './controllers/controllersByChartType/scatterplot-umap';\nimport { DemoDataStore } from './demoStore';\nimport type { ColumnOrAxisIdString } from './spec';\nimport { AxisId, ColumnId, columnOrAxisIdFromString, isColumnId } from './spec';\nimport { PValue } from './store';\nimport type {AxisSpec, PColumnSpec} from '@milaboratories/pl-model-common';\n\nconst PfPlots = {\n controllers: {\n discrete: new DiscreteStateController(),\n scatterplot: new ScatterplotStateController(),\n 'scatterplot-umap': new ScatterplotUmapStateController(),\n heatmap: new HeatmapStateController(),\n dendro: new DendroStateController(),\n histogram: new HistogramStateController(),\n bubble: new BubbleStateController(),\n },\n initialStates: {\n discrete: InitialDiscreteState,\n scatterplot: InitialScatterplotState,\n 'scatterplot-umap': InitialScatterplotUmapState,\n heatmap: InitialHeatmapState,\n dendro: InitialDendroState,\n histogram: InitialHistogramState,\n bubble: InitialBubbleState,\n },\n};\n\nexport function getControllerByType<C extends ChartType>(chartType: C): Controller<InputStateParent<C>> {\n return PfPlots.controllers[chartType] as unknown as Controller<InputStateParent<C>>;\n}\n\nexport function getInitialStateByType<C extends ChartType>(chartType: C): InputStateParent<C> {\n return PfPlots.initialStates[chartType] as unknown as InputStateParent<C>;\n}\n\ntype InputNamesByChartType = {\n [K in ChartType]: K extends 'discrete' ?\n keyof DiscreteUIState['components'] : K extends 'heatmap' ?\n keyof HeatmapUIState['components'] : K extends 'dendro' ?\n keyof DendroUIState['components'] : K extends 'scatterplot' ?\n keyof ScatterplotUIState['components'] : K extends 'scatterplot-umap' ?\n keyof ScatterplotUmapUIState['components'] : K extends 'histogram' ?\n keyof HistogramUIState['components'] : K extends 'bubble' ?\n keyof BubbleUIState['components'] : never\n}\n\nexport {\n AxisData, AxisId, AxisSpec, BubbleStateController, ChartType, ColumnData, ColumnId, ColumnOrAxisData, columnOrAxisIdFromString, ColumnOrAxisIdString, ComponentGuideFilter,\n ComponentGuideSimple,\n ComponentStateFilter,\n ComponentStateSimple, Controller, DemoDataStore, DendroStateController, DendroUIState, DiscreteStateController, DiscreteUIState, HeatmapStateController, HeatmapUIState, InputGuide,\n InputState,\n InputStateParent, isColumnId, PColumnSpec, PlotDataAndSettings, ScatterplotStateController, ScatterplotUIState, SelectorStateFilter,\n SelectorStateSimple,\n SourceOption, type BubbleUIState, type HistogramUIState, type InputNamesByChartType, type PValue, type ScatterplotUmapUIState\n};\n"],"names":["PfPlots","DiscreteStateController","ScatterplotStateController","ScatterplotUmapStateController","HeatmapStateController","DendroStateController","HistogramStateController","BubbleStateController","InitialDiscreteState","InitialScatterplotState","InitialScatterplotUmapState","InitialHeatmapState","InitialDendroState","InitialHistogramState","InitialBubbleState","getControllerByType","chartType","getInitialStateByType"],"mappings":";;;;;;;;;;AA0CA,MAAMA,IAAU;AAAA,EACZ,aAAa;AAAA,IACT,UAAU,IAAIC,EAAAA;AAAAA,IACd,aAAa,IAAIC,EAAAA;AAAAA,IACjB,oBAAoB,IAAIC,EAAAA;AAAAA,IACxB,SAAS,IAAIC,EAAAA;AAAAA,IACb,QAAQ,IAAIC,EAAAA;AAAAA,IACZ,WAAW,IAAIC,EAAAA;AAAAA,IACf,QAAQ,IAAIC,EAAAA;AAAAA,EAAsB;AAAA,EAEtC,eAAe;AAAA,IACX,UAAUC;AAAAA,IACV,aAAaC;AAAAA,IACb,oBAAoBC;AAAAA,IACpB,SAASC;AAAAA,IACT,QAAQC;AAAAA,IACR,WAAWC;AAAAA,IACX,QAAQC;AAAAA,EAAA;AAEhB;AAEO,SAASC,EAAyCC,GAA+C;AAC7F,SAAAhB,EAAQ,YAAYgB,CAAS;AACxC;AAEO,SAASC,EAA2CD,GAAmC;AACnF,SAAAhB,EAAQ,cAAcgB,CAAS;AAC1C;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.js","sources":["../../../../../node_modules/@milaboratories/pf-plots/src/index.ts"],"sourcesContent":["import type {\n AxisData,\n ChartType,\n ColumnData,\n ColumnOrAxisData,\n ComponentGuideFilter,\n ComponentGuideSimple,\n ComponentStateFilter,\n ComponentStateSimple,\n InputGuide,\n InputState,\n InputStateParent,\n SelectorStateFilter,\n SelectorStateSimple,\n SourceOption,\n} from './common';\nimport type { Controller, PlotDataAndSettings } from './controllers/ControllerBase';\nimport { BubbleStateController, BubbleUIState, InitialBubbleState } from './controllers/controllersByChartType/bubble';\nimport type { DendroUIState } from './controllers/controllersByChartType/dendro';\nimport { DendroStateController, InitialDendroState } from './controllers/controllersByChartType/dendro';\nimport type { DiscreteUIState } from './controllers/controllersByChartType/discrete';\nimport { DiscreteStateController, InitialDiscreteState } from './controllers/controllersByChartType/discrete';\nimport type { HeatmapUIState } from './controllers/controllersByChartType/heatmap';\nimport { HeatmapStateController, InitialHeatmapState } from './controllers/controllersByChartType/heatmap';\nimport {\n HistogramStateController,\n HistogramUIState,\n InitialHistogramState,\n} from './controllers/controllersByChartType/histogram';\nimport type { ScatterplotUIState } from './controllers/controllersByChartType/scatterplot';\nimport { InitialScatterplotState, ScatterplotStateController } from './controllers/controllersByChartType/scatterplot';\nimport {\n InitialScatterplotUmapState,\n ScatterplotUmapStateController,\n ScatterplotUmapUIState,\n} from './controllers/controllersByChartType/scatterplot-umap';\nimport { DemoDataStore } from './demoStore';\nimport type { ColumnOrAxisIdString } from './spec';\nimport { AxisId, ColumnId, columnOrAxisIdFromString, isColumnId } from './spec';\nimport { PValue } from './store';\nimport type {AxisSpec, PColumnSpec} from '@milaboratories/pl-model-common';\n\nconst PfPlots = {\n controllers: {\n discrete: new DiscreteStateController(),\n scatterplot: new ScatterplotStateController(),\n 'scatterplot-umap': new ScatterplotUmapStateController(),\n heatmap: new HeatmapStateController(),\n dendro: new DendroStateController(),\n histogram: new HistogramStateController(),\n bubble: new BubbleStateController(),\n },\n initialStates: {\n discrete: InitialDiscreteState,\n scatterplot: InitialScatterplotState,\n 'scatterplot-umap': InitialScatterplotUmapState,\n heatmap: InitialHeatmapState,\n dendro: InitialDendroState,\n histogram: InitialHistogramState,\n bubble: InitialBubbleState,\n },\n};\n\nexport function getControllerByType<C extends ChartType>(chartType: C): Controller<InputStateParent<C>> {\n return PfPlots.controllers[chartType] as unknown as Controller<InputStateParent<C>>;\n}\n\nexport function getInitialStateByType<C extends ChartType>(chartType: C): InputStateParent<C> {\n return PfPlots.initialStates[chartType] as unknown as InputStateParent<C>;\n}\n\ntype InputNamesByChartType = {\n [K in ChartType]: K extends 'discrete' ?\n keyof DiscreteUIState['components'] : K extends 'heatmap' ?\n keyof HeatmapUIState['components'] : K extends 'dendro' ?\n keyof DendroUIState['components'] : K extends 'scatterplot' ?\n keyof ScatterplotUIState['components'] : K extends 'scatterplot-umap' ?\n keyof ScatterplotUmapUIState['components'] : K extends 'histogram' ?\n keyof HistogramUIState['components'] : K extends 'bubble' ?\n keyof BubbleUIState['components'] : never\n}\n\nexport {\n AxisData, AxisId, AxisSpec, BubbleStateController, ChartType, ColumnData, ColumnId, ColumnOrAxisData, columnOrAxisIdFromString, ColumnOrAxisIdString, ComponentGuideFilter,\n ComponentGuideSimple,\n ComponentStateFilter,\n ComponentStateSimple, Controller, DemoDataStore, DendroStateController, DendroUIState, DiscreteStateController, DiscreteUIState, HeatmapStateController, HeatmapUIState, InputGuide,\n InputState,\n InputStateParent, isColumnId, PColumnSpec, PlotDataAndSettings, ScatterplotStateController, ScatterplotUIState, SelectorStateFilter,\n SelectorStateSimple,\n SourceOption, type BubbleUIState, type HistogramUIState, type InputNamesByChartType, type PValue, type ScatterplotUmapUIState\n};\n"],"names":["PfPlots","DiscreteStateController","ScatterplotStateController","ScatterplotUmapStateController","HeatmapStateController","DendroStateController","HistogramStateController","BubbleStateController","InitialDiscreteState","InitialScatterplotState","InitialScatterplotUmapState","InitialHeatmapState","InitialDendroState","InitialHistogramState","InitialBubbleState","getControllerByType","chartType","getInitialStateByType"],"mappings":";;;;;;;;;;;;;AA0CA,MAAMA,IAAU;AAAA,EACZ,aAAa;AAAA,IACT,UAAU,IAAIC,EAAAA;AAAAA,IACd,aAAa,IAAIC,EAAAA;AAAAA,IACjB,oBAAoB,IAAIC,EAAAA;AAAAA,IACxB,SAAS,IAAIC,EAAAA;AAAAA,IACb,QAAQ,IAAIC,EAAAA;AAAAA,IACZ,WAAW,IAAIC,EAAAA;AAAAA,IACf,QAAQ,IAAIC,EAAAA;AAAAA,EAAsB;AAAA,EAEtC,eAAe;AAAA,IACX,UAAUC;AAAAA,IACV,aAAaC;AAAAA,IACb,oBAAoBC;AAAAA,IACpB,SAASC;AAAAA,IACT,QAAQC;AAAAA,IACR,WAAWC;AAAAA,IACX,QAAQC;AAAAA,EAAA;AAEhB;AAEO,SAASC,EAAyCC,GAA+C;AAC7F,SAAAhB,EAAQ,YAAYgB,CAAS;AACxC;AAEO,SAASC,EAA2CD,GAAmC;AACnF,SAAAhB,EAAQ,cAAcgB,CAAS;AAC1C;","x_google_ignoreList":[0]}
@@ -33,4 +33,4 @@ export {
33
33
  e as PlErrorLike,
34
34
  n as StandardErrorLike
35
35
  };
36
- //# sourceMappingURL=index.js.map
36
+ //# sourceMappingURL=error_like_shape.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error_like_shape.js","sources":["../../../../../../../../../node_modules/@milaboratories/pf-plots/node_modules/@milaboratories/pl-error-like/src/error_like_shape.ts"],"sourcesContent":["import stringify from 'json-stringify-safe';\nimport { z } from 'zod';\n\n// We want to define StandardErrorLike and PlErrorLike, it's a way to define recursive types in zod.\n// https://zod.dev/?id=recursive-types\n// We need zod to parse error strings into these objects for keeping new UI and old blocks compatible.\n\nexport const BasePlErrorLike = z.object({\n type: z.literal('PlError'),\n name: z.string(),\n message: z.string(),\n /** The message with all details needed for SDK developers. */\n fullMessage: z.string().optional(),\n stack: z.string().optional(),\n});\n\n/** Known Pl backend and ML errors. */\nexport type PlErrorLike = z.infer<typeof BasePlErrorLike> & {\n cause?: ErrorLike;\n errors?: ErrorLike[];\n};\n\nexport const PlErrorLike: z.ZodType<PlErrorLike> = BasePlErrorLike.extend({\n cause: z.lazy(() => ErrorLike).optional(),\n errors: z.lazy(() => ErrorLike.array()).optional(),\n});\n\nconst BaseStandardErrorLike = z.object({\n type: z.literal('StandardError'),\n name: z.string(),\n message: z.string(),\n stack: z.string().optional(),\n});\n\n/** Others unknown errors that could be thrown by the client. */\nexport type StandardErrorLike = z.infer<typeof BaseStandardErrorLike> & {\n cause?: ErrorLike;\n errors?: ErrorLike[];\n};\n\nexport const StandardErrorLike: z.ZodType<StandardErrorLike> = BaseStandardErrorLike.extend({\n cause: z.lazy(() => ErrorLike).optional(),\n errors: z.lazy(() => ErrorLike.array()).optional(),\n});\n\nexport const ErrorLike = z.union([StandardErrorLike, PlErrorLike]);\nexport type ErrorLike = z.infer<typeof ErrorLike>;\n\n/** Converts everything into ErrorLike. */\nexport function ensureErrorLike(error: unknown): ErrorLike {\n const result = ErrorShape.safeParse(error);\n\n if (result.success) {\n const err = result.data;\n\n if (err.name === 'PlQuickJSError'\n || err.name === 'PlErrorReport'\n || err.name === 'PlInternalError'\n || err.name === 'PlTengoError'\n || err.name === 'PlRunnerError'\n || err.name === 'PlMonetizationError') {\n return {\n type: 'PlError',\n name: err.name,\n message: err.message,\n fullMessage: err.fullMessage ?? undefined,\n stack: err.stack ?? undefined,\n cause: err.cause ? ensureErrorLike(err.cause) : undefined,\n errors: err.errors ? err.errors.map(ensureErrorLike) : undefined,\n };\n }\n\n return {\n type: 'StandardError',\n name: err.name,\n message: err.message,\n stack: err.stack ?? undefined,\n cause: err.cause ? ensureErrorLike(err.cause) : undefined,\n errors: err.errors ? err.errors.map(ensureErrorLike) : undefined,\n };\n }\n\n return {\n type: 'StandardError',\n name: 'Error',\n // Stringify without circular dependencies.\n // Maps (and sets?) will be converted to empty json objects,\n // if this is a problem, we should change the library,\n // but the new library must work in all QuickJS, UI and Node.js like this one.\n message: stringify(error),\n };\n}\n\n/** Tries to parse strings into ErrorLike. It's needed for keeping old blocks compatible with new UI. */\nexport function parseErrorLikeSafe(err: string): {\n success: true;\n data: ErrorLike;\n} | {\n success: false;\n error: Error;\n} {\n try {\n return ErrorLike.safeParse(JSON.parse(err));\n } catch (e) {\n return { success: false, error: new Error(`parseErrorLikeSafe: could not parse JSON: ${err}, ${String(e)}`) };\n }\n}\n\n// We want to define ErrorShape schema just to parse it above, it's a way to define recursive types in zod.\n// https://zod.dev/?id=recursive-types\n\nconst baseErrorShape = z.object({\n name: z.string(),\n message: z.string(),\n fullMessage: z.string().optional(),\n stack: z.string().optional(),\n});\n\ntype ErrorShape = z.infer<typeof baseErrorShape> & {\n cause?: ErrorShape;\n errors?: ErrorShape[];\n};\n\nconst ErrorShape: z.ZodType<ErrorShape> = baseErrorShape.extend({\n cause: z.lazy(() => ErrorShape).optional(),\n errors: z.lazy(() => ErrorShape.array()).optional(),\n});\n"],"names":["BasePlErrorLike","z","PlErrorLike","ErrorLike","BaseStandardErrorLike","StandardErrorLike","baseErrorShape","ErrorShape"],"mappings":";;AAOO,MAAMA,IAAkBC,EAAE,OAAO;AAAA,EACtC,MAAMA,EAAE,QAAQ,SAAS;AAAA,EACzB,MAAMA,EAAE,OAAA;AAAA,EACR,SAASA,EAAE,OAAA;AAAA;AAAA,EAEX,aAAaA,EAAE,OAAA,EAAS,SAAA;AAAA,EACxB,OAAOA,EAAE,OAAA,EAAS,SAAA;AACnB,CAAA,GAQYC,IAAsCF,EAAgB,OAAO;AAAA,EACxE,OAAOC,EAAE,KAAK,MAAME,CAAS,EAAE,SAAA;AAAA,EAC/B,QAAQF,EAAE,KAAK,MAAME,EAAU,MAAA,CAAO,EAAE,SAAA;AACzC,CAAA,GAEKC,IAAwBH,EAAE,OAAO;AAAA,EACrC,MAAMA,EAAE,QAAQ,eAAe;AAAA,EAC/B,MAAMA,EAAE,OAAA;AAAA,EACR,SAASA,EAAE,OAAA;AAAA,EACX,OAAOA,EAAE,OAAA,EAAS,SAAA;AACnB,CAAA,GAQYI,IAAkDD,EAAsB,OAAO;AAAA,EAC1F,OAAOH,EAAE,KAAK,MAAME,CAAS,EAAE,SAAA;AAAA,EAC/B,QAAQF,EAAE,KAAK,MAAME,EAAU,MAAA,CAAO,EAAE,SAAA;AACzC,CAAA,GAEYA,IAAYF,EAAE,MAAM,CAACI,GAAmBH,CAAW,CAAC,GAkE3DI,IAAiBL,EAAE,OAAO;AAAA,EAC9B,MAAMA,EAAE,OAAA;AAAA,EACR,SAASA,EAAE,OAAA;AAAA,EACX,aAAaA,EAAE,OAAA,EAAS,SAAA;AAAA,EACxB,OAAOA,EAAE,OAAA,EAAS,SAAA;AACnB,CAAA,GAOKM,IAAoCD,EAAe,OAAO;AAAA,EAC9D,OAAOL,EAAE,KAAK,MAAMM,CAAU,EAAE,SAAA;AAAA,EAChC,QAAQN,EAAE,KAAK,MAAMM,EAAW,MAAA,CAAO,EAAE,SAAA;AAC1C,CAAA;","x_google_ignoreList":[0]}
@@ -0,0 +1,8 @@
1
+ import m from "../../../../zod/lib/index.js";
2
+ m.object({
3
+ /** Included left border. */
4
+ from: m.number(),
5
+ /** Excluded right border. */
6
+ to: m.number()
7
+ });
8
+ //# sourceMappingURL=blob.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blob.js","sources":["../../../../../../../../../../node_modules/@milaboratories/pf-plots/node_modules/@milaboratories/pl-model-common/src/drivers/blob.ts"],"sourcesContent":["import type { Branded } from '../branding';\nimport { z } from 'zod';\n\n/** Handle of locally downloaded blob. This handle is issued only after the\n * blob's content is downloaded locally, and ready for quick access. */\nexport type LocalBlobHandle = Branded<string, 'LocalBlobHandle'>;\n\n/** Handle of remote blob. This handle is issued as soon as the data becomes\n * available on the remote server. */\nexport type RemoteBlobHandle = Branded<string, 'RemoteBlobHandle'>;\n\n/** Being configured inside the output structure provides information about\n * blob's content and means to retrieve it when needed. */\nexport interface BlobHandleAndSize<\n H extends LocalBlobHandle | RemoteBlobHandle = | LocalBlobHandle\n | RemoteBlobHandle,\n> {\n /** Handle to retrieve block content using {@link BlobDriver.getContent()} */\n readonly handle: H;\n\n /** Blob size in bytes. */\n readonly size: number;\n}\n\n/** Range in bytes, from should be less or equal than to. */\nexport const RangeBytes = z.object({\n /** Included left border. */\n from: z.number(),\n /** Excluded right border. */\n to: z.number(),\n});\n\nexport type RangeBytes = z.infer<typeof RangeBytes>;\n\nexport function newRangeBytesOpt(from?: number, to?: number): RangeBytes | undefined {\n if (from == undefined || to == undefined) {\n return undefined;\n }\n\n return { from, to };\n}\n\nexport function validateRangeBytes(range: RangeBytes, errMsg: string) {\n if (range.from < 0 || range.to < 0 || range.from >= range.to) {\n throw new Error(`${errMsg}: invalid bytes range: ${range}`);\n }\n}\n\n/** Being configured inside the output structure provides information about\n * locally downloaded blob and means to retrieve it's content when needed. This\n * structure is created only after the blob's content is downloaded locally, and\n * ready for quick access. */\nexport type LocalBlobHandleAndSize = BlobHandleAndSize<LocalBlobHandle>;\n\n/** Being configured inside the output structure provides information about\n * remote blob and means to retrieve it's content when needed. This structure\n * is created as soon as remote blob becomes available. */\nexport type RemoteBlobHandleAndSize = BlobHandleAndSize<RemoteBlobHandle>;\n\n/** Defines API of blob driver as it is seen from the block UI code. */\nexport interface BlobDriver {\n /** Given the blob handle returns its content. Depending on the handle type,\n * content will be served from locally downloaded file, or directly from\n * remote platforma storage. */\n getContent(handle: LocalBlobHandle | RemoteBlobHandle, range?: RangeBytes): Promise<Uint8Array>;\n}\n"],"names":["z"],"mappings":";AAyB0BA,EAAE,OAAO;AAAA;AAAA,EAEjC,MAAMA,EAAE,OAAA;AAAA;AAAA,EAER,IAAIA,EAAE,OAAA;AACP,CAAA;","x_google_ignoreList":[0]}
@@ -0,0 +1,63 @@
1
+ import { ValueType as a } from "./spec/spec.js";
2
+ function o(r, e) {
3
+ const t = Math.floor(e / 8), n = 1 << 7 - e % 8;
4
+ return (r[t] & n) > 0;
5
+ }
6
+ function s(r, e) {
7
+ return o(r.absent, e);
8
+ }
9
+ function c(r, e) {
10
+ if (r.isNA)
11
+ return o(r.isNA, e);
12
+ const t = r.type, n = r.data[e];
13
+ switch (t) {
14
+ case a.Int:
15
+ return n === -2147483648;
16
+ case a.Long:
17
+ return n === -9007199254740991n;
18
+ case a.Float:
19
+ return Number.isNaN(n);
20
+ case a.Double:
21
+ return Number.isNaN(n);
22
+ case a.String:
23
+ return n === null;
24
+ case a.Bytes:
25
+ return n === null;
26
+ default:
27
+ throw Error(`unsupported data type: ${t}`);
28
+ }
29
+ }
30
+ const i = { type: "absent" }, l = null;
31
+ function p(r, e, t) {
32
+ const n = r.type;
33
+ if (n === a.Bytes)
34
+ throw Error("Bytes not yet supported");
35
+ if (t && "dataType" in t && t.dataType !== void 0 && t.dataType !== n)
36
+ throw Error(`expected column of type ${t.dataType}, got ${n}`);
37
+ if (s(r, e))
38
+ return (t == null ? void 0 : t.absent) !== void 0 ? t.absent : i;
39
+ if (c(r, e))
40
+ return (t == null ? void 0 : t.na) !== void 0 ? t.na : l;
41
+ const u = r.data[e];
42
+ switch (n) {
43
+ case a.Int:
44
+ return u;
45
+ case a.Long:
46
+ return Number(u);
47
+ case a.Float:
48
+ return u;
49
+ case a.Double:
50
+ return u;
51
+ case a.String:
52
+ return u;
53
+ }
54
+ }
55
+ function y(r, e, t) {
56
+ return p(r, e, t);
57
+ }
58
+ export {
59
+ i as PTableAbsent,
60
+ l as PTableNA,
61
+ y as pTableValue
62
+ };
63
+ //# sourceMappingURL=data_types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data_types.js","sources":["../../../../../../../../../../../node_modules/@milaboratories/pf-plots/node_modules/@milaboratories/pl-model-common/src/drivers/pframe/data_types.ts"],"sourcesContent":["import type { Branded } from '../../branding';\nimport { ValueType } from './spec/spec';\n\nexport type PVectorDataInt = Int32Array;\nexport type PVectorDataLong = BigInt64Array;\nexport type PVectorDataFloat = Float32Array;\nexport type PVectorDataDouble = Float64Array;\nexport type PVectorDataString = (null | string)[];\nexport type PVectorDataBytes = (null | Uint8Array)[];\nexport type PVectorDataTyped<DataType extends ValueType> =\n DataType extends typeof ValueType.Int ? PVectorDataInt :\n DataType extends typeof ValueType.Long ? PVectorDataLong :\n DataType extends typeof ValueType.Float ? PVectorDataFloat :\n DataType extends typeof ValueType.Double ? PVectorDataDouble :\n DataType extends typeof ValueType.String ? PVectorDataString :\n DataType extends typeof ValueType.Bytes ? PVectorDataBytes :\n never;\nexport type PVectorData = PVectorDataTyped<ValueType>;\n\nexport type PTableVectorTyped<DataType extends ValueType> = {\n /** Stored data type */\n readonly type: DataType;\n\n /** Values for present positions, absent positions have NA values */\n readonly data: PVectorDataTyped<DataType>;\n\n /**\n * Encoded bit array marking some elements of this vector as NA,\n * call {@link bitSet} to read the data.\n * In old desktop versions NA values are encoded as magic values in data array.\n * */\n readonly isNA?: Uint8Array;\n\n /**\n * Encoded bit array marking some elements of this vector as absent,\n * call {@link bitSet} to read the data.\n * */\n readonly absent: Uint8Array;\n};\n/** Table column data in comparison to the data stored in a separate PColumn\n * may have some of the values \"absent\", i.e. as a result of missing record in\n * outer join operation. This information is encoded in {@link absent} field. */\nexport type PTableVector = PTableVectorTyped<ValueType>;\n\nfunction isBitSet(bitVector: Uint8Array, offset: number): boolean {\n const chunkIndex = Math.floor(offset / 8);\n const mask = 1 << (7 - (offset % 8));\n return (bitVector[chunkIndex] & mask) > 0;\n}\n\nfunction isValueAbsent(vector: PTableVector, row: number): boolean {\n return isBitSet(vector.absent, row);\n}\n\nfunction isValueNA(vector: PTableVector, row: number): boolean {\n if (vector.isNA) return isBitSet(vector.isNA, row);\n\n // Check for legacy magic values to support old desktop versions\n const valueType = vector.type;\n const value = vector.data[row];\n switch (valueType) {\n case ValueType.Int:\n return (value as PVectorDataInt[number]) === -2147483648;\n case ValueType.Long:\n return (value as PVectorDataLong[number]) === -9007199254740991n;\n case ValueType.Float:\n return Number.isNaN((value as PVectorDataFloat[number]));\n case ValueType.Double:\n return Number.isNaN((value as PVectorDataDouble[number]));\n case ValueType.String:\n return (value as PVectorDataString[number]) === null;\n case ValueType.Bytes:\n return (value as PVectorDataBytes[number]) === null;\n default:\n throw Error(`unsupported data type: ${valueType satisfies never}`);\n }\n}\n\nexport const PTableAbsent = { type: 'absent' } as const;\nexport type PTableAbsent = typeof PTableAbsent;\n\n/** Type guard for absent value */\nexport function isPTableAbsent(value: unknown): value is PTableAbsent {\n return typeof value === 'object' && value !== null && 'type' in value && value.type === 'absent';\n}\n\nexport const PTableNA = null;\nexport type PTableNA = typeof PTableNA;\n\n/** Type guard for NA value */\nexport function isPTableNA(value: unknown): value is PTableNA {\n return value === PTableNA;\n}\n\nexport type ValueTypeSupported = Exclude<ValueType, typeof ValueType.Bytes>;\n\nexport type PTableValueInt = number;\nexport type PTableValueLong = number;\nexport type PTableValueFloat = number;\nexport type PTableValueDouble = number;\nexport type PTableValueString = string;\nexport type PTableValueData<DataType extends ValueTypeSupported> =\n DataType extends typeof ValueType.Int ? PTableValueInt :\n DataType extends typeof ValueType.Long ? PTableValueLong :\n DataType extends typeof ValueType.Float ? PTableValueFloat :\n DataType extends typeof ValueType.Double ? PTableValueDouble :\n DataType extends typeof ValueType.String ? PTableValueString :\n never;\nexport type PTableValueDataBranded<DataType extends ValueTypeSupported> = Branded<PTableValueData<DataType>, DataType>;\nexport type PTableValue<\n Absent = PTableAbsent,\n NA = PTableNA,\n DataType extends ValueTypeSupported = ValueTypeSupported,\n> = Absent | NA | PTableValueData<DataType>;\nexport type PTableValueBranded<\n Absent = PTableAbsent,\n NA = PTableNA,\n DataType extends ValueTypeSupported = ValueTypeSupported,\n> = Absent | NA | PTableValueDataBranded<DataType>;\n\nexport type PTableValueAxis<\n Absent = PTableAbsent,\n DataType extends ValueTypeSupported = ValueTypeSupported,\n> = PTableValue<Absent, never, DataType>;\n\nexport function isPTableValueAxis<Absent, NA, DataType extends ValueTypeSupported>(\n value: PTableValue<Absent, NA, DataType>,\n isNA: (value: PTableValue<Absent, NA, DataType>) => value is NA,\n): value is PTableValueAxis<Absent, DataType>;\nexport function isPTableValueAxis<Absent, DataType extends ValueTypeSupported>(\n value: PTableValue<Absent, PTableNA, DataType>,\n): value is PTableValueAxis<Absent, DataType>;\nexport function isPTableValueAxis<\n Absent = PTableAbsent,\n NA = PTableNA,\n DataType extends ValueTypeSupported = ValueTypeSupported,\n>(\n value: PTableValue<Absent, NA, DataType>,\n isNA?: (value: PTableValue<Absent, NA, DataType>) => value is NA,\n): value is PTableValueAxis<Absent, DataType> {\n return !(isNA ? isNA(value) : isPTableNA(value));\n}\n\nfunction pTableValueImpl<\n FillAbsent = PTableAbsent,\n FillNA = PTableNA,\n DataType extends ValueType = ValueTypeSupported,\n>(\n column: PTableVectorTyped<ValueType>,\n row: number,\n options?: {\n absent?: FillAbsent;\n na?: FillNA;\n dataType?: DataType;\n },\n) {\n const valueType = column.type;\n if (valueType === ValueType.Bytes) {\n throw Error('Bytes not yet supported');\n }\n\n if (options && 'dataType' in options && options.dataType !== undefined && options.dataType !== valueType) {\n throw Error(`expected column of type ${options.dataType}, got ${valueType}`);\n }\n\n if (isValueAbsent(column, row)) {\n return options?.absent !== undefined ? options.absent : PTableAbsent;\n }\n\n if (isValueNA(column, row)) {\n return options?.na !== undefined ? options.na : PTableNA;\n }\n\n const value = column.data[row]!;\n switch (valueType) {\n case ValueType.Int:\n return value as PVectorDataInt[number];\n case ValueType.Long:\n return Number(value as PVectorDataLong[number]);\n case ValueType.Float:\n return value as PVectorDataFloat[number];\n case ValueType.Double:\n return value as PVectorDataDouble[number];\n case ValueType.String:\n return (value as PVectorDataString[number])!;\n }\n}\n\n/** Read PTableValue from PTable column at specified row */\nexport function pTableValue<DataType extends ValueType>(\n column: PTableVectorTyped<DataType>,\n row: number,\n): DataType extends ValueTypeSupported ? PTableValue<PTableAbsent, PTableNA, DataType> : never;\nexport function pTableValue<FillAbsent, DataType extends ValueType>(\n column: PTableVectorTyped<DataType>,\n row: number,\n options: {\n absent: FillAbsent;\n }\n): DataType extends ValueTypeSupported ? PTableValue<FillAbsent, PTableNA, DataType> : never;\nexport function pTableValue<FillNA, DataType extends ValueType>(\n column: PTableVectorTyped<DataType>,\n row: number,\n options: {\n na: FillNA;\n }\n): DataType extends ValueTypeSupported ? PTableValue<PTableAbsent, FillNA, DataType> : never;\nexport function pTableValue<FillNA, FillAbsent, DataType extends ValueType>(\n column: PTableVectorTyped<DataType>,\n row: number,\n options: {\n absent: FillAbsent;\n na: FillNA;\n }\n): DataType extends ValueTypeSupported ? PTableValue<FillAbsent, FillNA, DataType> : never;\nexport function pTableValue<FillAbsent, DataType extends ValueTypeSupported>(\n column: PTableVectorTyped<ValueType>,\n row: number,\n options: {\n absent: FillAbsent;\n dataType: DataType;\n }\n): PTableValue<FillAbsent, PTableNA>;\nexport function pTableValue<FillNA, DataType extends ValueTypeSupported>(\n column: PTableVectorTyped<ValueType>,\n row: number,\n options: {\n na: FillNA;\n dataType: DataType;\n }\n): PTableValue<PTableAbsent, FillNA, DataType>;\nexport function pTableValue<FillNA, FillAbsent, DataType extends ValueTypeSupported>(\n column: PTableVectorTyped<ValueType>,\n row: number,\n options: {\n absent: FillAbsent;\n na: FillNA;\n dataType: DataType;\n }\n): PTableValue<FillAbsent, FillNA, DataType>;\nexport function pTableValue<\n FillAbsent = PTableAbsent,\n FillNA = PTableNA,\n DataType extends ValueType = ValueTypeSupported,\n>(\n column: PTableVectorTyped<ValueType>,\n row: number,\n options?: {\n absent?: FillAbsent;\n na?: FillNA;\n dataType?: DataType;\n },\n) {\n return pTableValueImpl(column, row, options);\n}\n\nexport function pTableValueBranded<DataType extends ValueType>(\n column: PTableVectorTyped<DataType>,\n row: number,\n): DataType extends ValueTypeSupported ? PTableValueBranded<PTableAbsent, PTableNA, DataType> : never;\nexport function pTableValueBranded<FillAbsent, DataType extends ValueType>(\n column: PTableVectorTyped<DataType>,\n row: number,\n options: {\n absent: FillAbsent;\n }\n): DataType extends ValueTypeSupported ? PTableValueBranded<FillAbsent, PTableNA, DataType> : never;\nexport function pTableValueBranded<FillNA, DataType extends ValueType>(\n column: PTableVectorTyped<DataType>,\n row: number,\n options: {\n na: FillNA;\n }\n): DataType extends ValueTypeSupported ? PTableValueBranded<PTableAbsent, FillNA, DataType> : never;\nexport function pTableValueBranded<FillNA, FillAbsent, DataType extends ValueType>(\n column: PTableVectorTyped<DataType>,\n row: number,\n options: {\n absent: FillAbsent;\n na: FillNA;\n }\n): DataType extends ValueTypeSupported ? PTableValueBranded<FillAbsent, FillNA, DataType> : never;\nexport function pTableValueBranded<FillAbsent, DataType extends ValueTypeSupported>(\n column: PTableVectorTyped<ValueType>,\n row: number,\n options: {\n absent: FillAbsent;\n dataType: DataType;\n }\n): PTableValueBranded<FillAbsent, PTableNA>;\nexport function pTableValueBranded<FillNA, DataType extends ValueTypeSupported>(\n column: PTableVectorTyped<ValueType>,\n row: number,\n options: {\n na: FillNA;\n dataType: DataType;\n }\n): PTableValueBranded<PTableAbsent, FillNA, DataType>;\nexport function pTableValueBranded<FillNA, FillAbsent, DataType extends ValueTypeSupported>(\n column: PTableVectorTyped<ValueType>,\n row: number,\n options: {\n absent: FillAbsent;\n na: FillNA;\n dataType: DataType;\n }\n): PTableValueBranded<FillAbsent, FillNA, DataType>;\nexport function pTableValueBranded<\n FillAbsent = PTableAbsent,\n FillNA = PTableNA,\n DataType extends ValueType = ValueTypeSupported,\n>(\n column: PTableVectorTyped<ValueType>,\n row: number,\n options?: {\n absent?: FillAbsent;\n na?: FillNA;\n dataType?: DataType;\n },\n) {\n return pTableValueImpl(column, row, options);\n}\n\n/** Used in requests to partially retrieve table's data */\nexport type TableRange = {\n /** Index of the first record to retrieve */\n readonly offset: number;\n\n /** Block length */\n readonly length: number;\n};\n\n/** Unified information about table shape */\nexport type PTableShape = {\n /** Number of unified table columns, including all axes and PColumn values */\n columns: number;\n\n /** Number of rows */\n rows: number;\n};\n"],"names":["isBitSet","bitVector","offset","chunkIndex","mask","isValueAbsent","vector","row","isValueNA","valueType","value","ValueType","PTableAbsent","PTableNA","pTableValueImpl","column","options","pTableValue"],"mappings":";AA4CA,SAASA,EAASC,GAAuBC,GAAc;AACrD,QAAMC,IAAa,KAAK,MAAMD,IAAS,CAAC,GAClCE,IAAO,KAAM,IAAKF,IAAS;AACjC,UAAQD,EAAUE,CAAU,IAAIC,KAAQ;AAC1C;AAEA,SAASC,EAAcC,GAAsBC,GAAW;AACtD,SAAOP,EAASM,EAAO,QAAQC,CAAG;AACpC;AAEA,SAASC,EAAUF,GAAsBC,GAAW;AAClD,MAAID,EAAO;AAAM,WAAON,EAASM,EAAO,MAAMC,CAAG;AAGjD,QAAME,IAAYH,EAAO,MACnBI,IAAQJ,EAAO,KAAKC,CAAG;AAC7B,UAAQE,GAAAA;AAAAA,IACN,KAAKE,EAAU;AACb,aAAQD,MAAqC;AAAA,IAC/C,KAAKC,EAAU;AACb,aAAQD,MAAsC,CAAC;AAAA,IACjD,KAAKC,EAAU;AACb,aAAO,OAAO,MAAOD,CAAkC;AAAA,IACzD,KAAKC,EAAU;AACb,aAAO,OAAO,MAAOD,CAAmC;AAAA,IAC1D,KAAKC,EAAU;AACb,aAAQD,MAAwC;AAAA,IAClD,KAAKC,EAAU;AACb,aAAQD,MAAuC;AAAA,IACjD;AACE,YAAM,MAAM,0BAA0BD,CAAyB,EAAE;AAAA,EAAA;AAEvE;AAEa,MAAAG,IAAe,EAAE,MAAM,SAAA,GAQvBC,IAAW;AAyDxB,SAASC,EAKPC,GACAR,GACAS,GAIC;AAED,QAAMP,IAAYM,EAAO;AACzB,MAAIN,MAAcE,EAAU;AAC1B,UAAM,MAAM,yBAAyB;AAGvC,MAAIK,KAAW,cAAcA,KAAWA,EAAQ,aAAa,UAAaA,EAAQ,aAAaP;AAC7F,UAAM,MAAM,2BAA2BO,EAAQ,QAAQ,SAASP,CAAS,EAAE;AAG7E,MAAIJ,EAAcU,GAAQR,CAAG;AAC3B,YAAOS,KAAA,OAAA,SAAAA,EAAS,YAAW,SAAYA,EAAQ,SAASJ;AAG1D,MAAIJ,EAAUO,GAAQR,CAAG;AACvB,YAAOS,KAAA,OAAA,SAAAA,EAAS,QAAO,SAAYA,EAAQ,KAAKH;AAGlD,QAAMH,IAAQK,EAAO,KAAKR,CAAG;AAC7B,UAAQE,GAAAA;AAAAA,IACN,KAAKE,EAAU;AACb,aAAOD;AAAAA,IACT,KAAKC,EAAU;AACb,aAAO,OAAOD,CAAgC;AAAA,IAChD,KAAKC,EAAU;AACb,aAAOD;AAAAA,IACT,KAAKC,EAAU;AACb,aAAOD;AAAAA,IACT,KAAKC,EAAU;AACb,aAAQD;AAAAA,EAAA;AAEd;AAsDgB,SAAAO,EAKdF,GACAR,GACAS,GAIC;AAED,SAAOF,EAAgBC,GAAQR,GAAKS,CAAO;AAC7C;","x_google_ignoreList":[0]}
@@ -0,0 +1,152 @@
1
+ import { parseJson as k, canonicalizeJson as m } from "../../json.js";
2
+ import { readAnnotationJson as y, getNormalizedAxesList as w, getArrayFromAxisTree as x, getAxesTree as d, getAxisId as u, Annotation as S } from "./spec/spec.js";
3
+ var L = Object.defineProperty, v = (A, e, s) => e in A ? L(A, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : A[e] = s, F = (A, e, s) => v(A, e + "", s);
4
+ class p {
5
+ constructor(e) {
6
+ F(this, "data"), this.data = e;
7
+ }
8
+ get keys() {
9
+ return this.data.keys();
10
+ }
11
+ get keyAxesIds() {
12
+ return [...this.data.keys()].map(k);
13
+ }
14
+ static fromColumns(e) {
15
+ var s, t;
16
+ const a = /* @__PURE__ */ new Map();
17
+ for (const l of e.filter((o) => !!y(o.spec, S.IsLinkerColumn))) {
18
+ const o = p.getAxesGroups(w(l.spec.axesSpec));
19
+ if (o.length !== 2)
20
+ continue;
21
+ const [n, r] = o, c = p.getAxesRoots(n).map((i) => {
22
+ const h = x(d(i));
23
+ return [m(h.map(u)), h];
24
+ }), f = p.getAxesRoots(r).map((i) => {
25
+ const h = x(d(i));
26
+ return [m(h.map(u)), h];
27
+ });
28
+ for (const [i, h] of c)
29
+ a.has(i) || a.set(i, { keyAxesSpec: h, linkWith: /* @__PURE__ */ new Map() });
30
+ for (const [i, h] of f)
31
+ a.has(i) || a.set(i, { keyAxesSpec: h, linkWith: /* @__PURE__ */ new Map() });
32
+ for (const [i] of c)
33
+ for (const [h] of f)
34
+ (s = a.get(i)) == null || s.linkWith.set(h, l), (t = a.get(h)) == null || t.linkWith.set(i, l);
35
+ }
36
+ return new this(a);
37
+ }
38
+ /** Get all available nodes of linker graphs if start from sourceAxesKeys */
39
+ searchAvailableAxesKeys(e) {
40
+ const s = new Set(e), t = /* @__PURE__ */ new Set();
41
+ let a = e;
42
+ for (; a.length; ) {
43
+ const l = [];
44
+ for (const o of a) {
45
+ const n = this.data.get(o);
46
+ if (n)
47
+ for (const r of n.linkWith.keys())
48
+ !t.has(r) && !s.has(r) && (l.push(r), t.add(r));
49
+ }
50
+ a = l;
51
+ }
52
+ return t;
53
+ }
54
+ /** Get all linker columns that are necessary to reach endKey from startKey */
55
+ searchLinkerPath(e, s) {
56
+ const t = {};
57
+ let a = /* @__PURE__ */ new Set([e]);
58
+ const l = /* @__PURE__ */ new Set([e]);
59
+ for (; a.size; ) {
60
+ const o = /* @__PURE__ */ new Set();
61
+ for (const n of a) {
62
+ const r = this.data.get(n);
63
+ if (r)
64
+ for (const c of r.linkWith.keys())
65
+ if (t[c] = n, c === s) {
66
+ const f = [];
67
+ let i = s;
68
+ for (; t[i] !== e; )
69
+ f.push(i), i = t[i];
70
+ return f.push(i), f.map((h) => this.data.get(h).linkWith.get(t[h]));
71
+ } else l.has(c) || (o.add(c), l.add(c));
72
+ }
73
+ a = o;
74
+ }
75
+ return [];
76
+ }
77
+ getLinkerColumnsForAxes({ from: e, to: s, throwWhenNoLinkExists: t = !0 }) {
78
+ const a = e.map(p.getLinkerKeyFromAxisSpec);
79
+ return Array.from(new Map(p.getAxesRoots(s).map(p.getLinkerKeyFromAxisSpec).flatMap((l) => {
80
+ const o = a.map((n) => this.searchLinkerPath(n, l)).reduce((n, r) => n.length && n.length < r.length || !r.length ? n : r, []).map((n) => [n.columnId, n]);
81
+ if (!o.length && t)
82
+ throw Error(`Unable to find linker column for ${l}`);
83
+ return o;
84
+ })).values());
85
+ }
86
+ /** Get list of axisSpecs from keys of linker columns map */
87
+ getAxesListFromKeysList(e) {
88
+ return Array.from(new Map(e.flatMap((s) => {
89
+ var t;
90
+ return ((t = this.data.get(s)) == null ? void 0 : t.keyAxesSpec) ?? [];
91
+ }).map((s) => [m(u(s)), s])).values());
92
+ }
93
+ /** Get axes of target axes that are impossible to be linked to source axes with current linker map */
94
+ getNonLinkableAxes(e, s) {
95
+ const t = e.map(p.getLinkerKeyFromAxisSpec), a = s.map(p.getLinkerKeyFromAxisSpec);
96
+ return Array.from(new Map(s.filter((l, o) => {
97
+ const n = a[o];
98
+ return !t.some((r) => this.searchLinkerPath(r, n).length);
99
+ }).flatMap((l) => x(d(l)).map((o) => [m(u(o)), o]))).values());
100
+ }
101
+ /** Get all axes that can be connected to sourceAxes by linkers */
102
+ getReachableByLinkersAxesFromAxes(e) {
103
+ const s = e.map(p.getLinkerKeyFromAxisSpec), t = this.searchAvailableAxesKeys(s);
104
+ return this.getAxesListFromKeysList([...t]);
105
+ }
106
+ static getLinkerKeyFromAxisSpec(e) {
107
+ return m(x(d(e)).map(u));
108
+ }
109
+ /** Split array of axes into several arrays by parents: axes of one group are parents for each other.
110
+ There are no order inside every group. */
111
+ static getAxesGroups(e) {
112
+ switch (e.length) {
113
+ case 0:
114
+ return [];
115
+ case 1:
116
+ return [[e[0]]];
117
+ }
118
+ const s = e.map((r) => m(u(r))), t = e.map((r) => new Set(r.parentAxesSpec.map((c) => m(u(c))).map((c) => {
119
+ const f = s.indexOf(c);
120
+ if (f === -1)
121
+ throw new Error(`malformed axesSpec: ${JSON.stringify(e)}, unable to locate parent ${c}`);
122
+ return f;
123
+ }))), a = [...e.keys()], l = [], o = /* @__PURE__ */ new Set();
124
+ let n = a.find((r) => !o.has(r));
125
+ for (; n !== void 0; ) {
126
+ const r = [n];
127
+ o.add(n);
128
+ let c = [n];
129
+ for (; c.length; ) {
130
+ const f = /* @__PURE__ */ new Set();
131
+ for (const i of c) {
132
+ const h = t[i];
133
+ a.forEach((g) => {
134
+ g === i || o.has(g) || (t[g].has(i) || h.has(g)) && (r.push(g), f.add(g), o.add(g));
135
+ });
136
+ }
137
+ c = [...f];
138
+ }
139
+ l.push([...r]), n = a.find((f) => !o.has(f));
140
+ }
141
+ return l.map((r) => r.map((c) => e[c]));
142
+ }
143
+ /** Get all axes that are not parents of any other axis */
144
+ static getAxesRoots(e) {
145
+ const s = new Set(e.flatMap((t) => t.parentAxesSpec).map((t) => m(u(t))));
146
+ return e.filter((t) => !s.has(m(u(t))));
147
+ }
148
+ }
149
+ export {
150
+ p as LinkerMap
151
+ };
152
+ //# sourceMappingURL=linker_columns.js.map