@milaboratories/miplots4 1.2.2 → 1.2.4

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 (65) hide show
  1. package/dist/DataFrame.d.ts.map +1 -1
  2. package/dist/DataFrame.js +2 -1
  3. package/dist/DataFrame.js.map +1 -1
  4. package/dist/heatmap/ChartRenderer.d.ts.map +1 -1
  5. package/dist/heatmap/ChartRenderer.js +72 -78
  6. package/dist/heatmap/ChartRenderer.js.map +1 -1
  7. package/dist/selection/ChartRenderer.d.ts.map +1 -1
  8. package/dist/selection/ChartRenderer.js +9 -11
  9. package/dist/selection/ChartRenderer.js.map +1 -1
  10. package/dist/selection/SelectionSettingsImpl.d.ts +0 -1
  11. package/dist/selection/SelectionSettingsImpl.d.ts.map +1 -1
  12. package/dist/selection/SelectionSettingsImpl.js +0 -1
  13. package/dist/selection/SelectionSettingsImpl.js.map +1 -1
  14. package/dist/selection/components/Chart/Bars/GroupSelectedBars.js +1 -1
  15. package/dist/selection/components/Chart/Bars/GroupSelectedBars.js.map +1 -1
  16. package/dist/selection/components/Chart/Bars/StackedBars.d.ts.map +1 -1
  17. package/dist/selection/components/Chart/Bars/StackedBars.js +11 -11
  18. package/dist/selection/components/Chart/Bars/StackedBars.js.map +1 -1
  19. package/dist/selection/components/Chart/ChartAxes.d.ts.map +1 -1
  20. package/dist/selection/components/Chart/ChartAxes.js +7 -8
  21. package/dist/selection/components/Chart/ChartAxes.js.map +1 -1
  22. package/dist/selection/components/Chart/ChartFrame.d.ts +1 -2
  23. package/dist/selection/components/Chart/ChartFrame.d.ts.map +1 -1
  24. package/dist/selection/components/Chart/ChartFrame.js +8 -8
  25. package/dist/selection/components/Chart/ChartFrame.js.map +1 -1
  26. package/dist/selection/components/Chart/Gridlines.d.ts +2 -6
  27. package/dist/selection/components/Chart/Gridlines.d.ts.map +1 -1
  28. package/dist/selection/components/Chart/Gridlines.js +14 -26
  29. package/dist/selection/components/Chart/Gridlines.js.map +1 -1
  30. package/dist/selection/components/Chart/Ribbons/GroupFlowRibbon.js +1 -1
  31. package/dist/selection/components/Chart/Ribbons/GroupFlowRibbon.js.map +1 -1
  32. package/dist/selection/components/Chart/Ribbons/StackedGroupFlowRibbon.d.ts.map +1 -1
  33. package/dist/selection/components/Chart/Ribbons/StackedGroupFlowRibbon.js +27 -27
  34. package/dist/selection/components/Chart/Ribbons/StackedGroupFlowRibbon.js.map +1 -1
  35. package/dist/selection/components/Chart/SelectionXAxis.d.ts +18 -0
  36. package/dist/selection/components/Chart/SelectionXAxis.d.ts.map +1 -0
  37. package/dist/selection/components/Chart/SelectionXAxis.js +47 -0
  38. package/dist/selection/components/Chart/SelectionXAxis.js.map +1 -0
  39. package/dist/selection/components/Chart/types.d.ts +0 -1
  40. package/dist/selection/components/Chart/types.d.ts.map +1 -1
  41. package/dist/selection/components/Chart.d.ts.map +1 -1
  42. package/dist/selection/components/Chart.js +7 -12
  43. package/dist/selection/components/Chart.js.map +1 -1
  44. package/dist/selection/components/ChartsGroup.d.ts.map +1 -1
  45. package/dist/selection/components/ChartsGroup.js +73 -72
  46. package/dist/selection/components/ChartsGroup.js.map +1 -1
  47. package/dist/selection/components/types.d.ts +0 -1
  48. package/dist/selection/components/types.d.ts.map +1 -1
  49. package/dist/selection/constants.d.ts +1 -2
  50. package/dist/selection/constants.d.ts.map +1 -1
  51. package/dist/selection/constants.js +2 -2
  52. package/dist/selection/constants.js.map +1 -1
  53. package/dist/selection/createSelectionData.d.ts +2 -6
  54. package/dist/selection/createSelectionData.d.ts.map +1 -1
  55. package/dist/selection/createSelectionData.js +45 -59
  56. package/dist/selection/createSelectionData.js.map +1 -1
  57. package/dist/types/selection.d.ts +0 -5
  58. package/dist/types/selection.d.ts.map +1 -1
  59. package/dist/types/selection.js +0 -1
  60. package/dist/types/selection.js.map +1 -1
  61. package/dist/utils/computeChartInnerSize.d.ts +18 -0
  62. package/dist/utils/computeChartInnerSize.d.ts.map +1 -0
  63. package/dist/utils/computeChartInnerSize.js +22 -0
  64. package/dist/utils/computeChartInnerSize.js.map +1 -0
  65. package/package.json +1 -1
@@ -208,19 +208,16 @@ export declare const SelectionSettingsSchema: z.ZodObject<{
208
208
  }>;
209
209
  xAxis: z.ZodOptional<z.ZodObject<{
210
210
  title: z.ZodOptional<z.ZodString>;
211
- showGrid: z.ZodOptional<z.ZodBoolean>;
212
211
  showTicks: z.ZodOptional<z.ZodBoolean>;
213
212
  hiddenLabels: z.ZodOptional<z.ZodBoolean>;
214
213
  labelsPosition: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"center">, z.ZodLiteral<"45deg">, z.ZodLiteral<"90deg">]>>;
215
214
  }, "strip", z.ZodTypeAny, {
216
215
  title?: string | undefined;
217
- showGrid?: boolean | undefined;
218
216
  showTicks?: boolean | undefined;
219
217
  labelsPosition?: "center" | "45deg" | "90deg" | undefined;
220
218
  hiddenLabels?: boolean | undefined;
221
219
  }, {
222
220
  title?: string | undefined;
223
- showGrid?: boolean | undefined;
224
221
  showTicks?: boolean | undefined;
225
222
  labelsPosition?: "center" | "45deg" | "90deg" | undefined;
226
223
  hiddenLabels?: boolean | undefined;
@@ -329,7 +326,6 @@ export declare const SelectionSettingsSchema: z.ZodObject<{
329
326
  } | undefined;
330
327
  xAxis?: {
331
328
  title?: string | undefined;
332
- showGrid?: boolean | undefined;
333
329
  showTicks?: boolean | undefined;
334
330
  labelsPosition?: "center" | "45deg" | "90deg" | undefined;
335
331
  hiddenLabels?: boolean | undefined;
@@ -418,7 +414,6 @@ export declare const SelectionSettingsSchema: z.ZodObject<{
418
414
  } | undefined;
419
415
  xAxis?: {
420
416
  title?: string | undefined;
421
- showGrid?: boolean | undefined;
422
417
  showTicks?: boolean | undefined;
423
418
  labelsPosition?: "center" | "45deg" | "90deg" | undefined;
424
419
  hiddenLabels?: boolean | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"selection.d.ts","sourceRoot":"","sources":["../../src/types/selection.ts"],"names":[],"mappings":"AAAA,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiDrG,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
@@ -26,7 +26,6 @@ const c = s.object({
26
26
  }),
27
27
  xAxis: s.optional(s.object({
28
28
  title: s.optional(s.string()),
29
- showGrid: s.optional(s.boolean()),
30
29
  showTicks: s.optional(s.boolean()),
31
30
  hiddenLabels: s.optional(s.boolean()),
32
31
  labelsPosition: s.optional(r)
@@ -1 +1 @@
1
- {"version":3,"file":"selection.js","names":[],"sources":["../../src/types/selection.ts"],"sourcesContent":["import { z } from 'zod';\nimport { AesRecordSchema, ColumnNameSchema, DataValueSchema, DiscreteLabelsPositionSchema, FrameTypeSchema, LegendPositionSchema, TitlePositionSchema } from './common';\n\nexport const SelectionSettingsSchema = z.object({\n type: z.literal('selection'),\n\n selectionStage: ColumnNameSchema,\n weight: z.optional(ColumnNameSchema),\n grouping: z.optional(\n z.object({\n columnName: ColumnNameSchema,\n order: z.optional(z.array(DataValueSchema)),\n inheritedAes: z.optional(AesRecordSchema),\n }),\n ),\n\n facetBy: z.optional(z.array(ColumnNameSchema)),\n facetSettings: z.optional(\n z.object({\n /** Ordered list of facet keys (e.g. \"val1_val2\"); only these facets are shown, in this order. */\n order: z.optional(z.array(z.string())),\n nRows: z.optional(z.number()),\n nCols: z.optional(z.number()),\n }),\n ),\n\n legend: z.optional(\n z.object({\n show: z.optional(z.boolean()),\n position: z.optional(LegendPositionSchema),\n }),\n ),\n\n title: z.object({\n name: z.string(),\n show: z.optional(z.boolean()),\n position: z.optional(TitlePositionSchema),\n }),\n\n xAxis: z.optional(\n z.object({\n title: z.optional(z.string()),\n showGrid: z.optional(z.boolean()),\n showTicks: z.optional(z.boolean()),\n hiddenLabels: z.optional(z.boolean()),\n labelsPosition: z.optional(DiscreteLabelsPositionSchema),\n }),\n ),\n yAxis: z.optional(\n z.object({\n title: z.optional(z.string()),\n showGrid: z.optional(z.boolean()),\n showTicks: z.optional(z.boolean()),\n hiddenLabels: z.optional(z.boolean()),\n }),\n ),\n frame: z.optional(z.object({ type: z.optional(FrameTypeSchema) })),\n\n fillColor: z.union([\n z.string(),\n z.object({ type: z.string(), value: z.optional(z.string()) }),\n ]),\n\n opacity: z.optional(z.number()),\n\n size: z.optional(z.object({\n width: z.optional(z.number()),\n height: z.optional(z.number()),\n })),\n});\n\nexport type SelectionSettings = z.infer<typeof SelectionSettingsSchema>;\n"],"mappings":";;AAGA,MAAa,IAA0B,EAAE,OAAO;CAC9C,MAAM,EAAE,QAAQ,YAAY;CAE5B,gBAAgB;CAChB,QAAQ,EAAE,SAAS,EAAiB;CACpC,UAAU,EAAE,SACV,EAAE,OAAO;EACP,YAAY;EACZ,OAAO,EAAE,SAAS,EAAE,MAAM,EAAgB,CAAC;EAC3C,cAAc,EAAE,SAAS,EAAgB;EAC1C,CAAC,CACH;CAED,SAAS,EAAE,SAAS,EAAE,MAAM,EAAiB,CAAC;CAC9C,eAAe,EAAE,SACf,EAAE,OAAO;EAEP,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;EACtC,OAAO,EAAE,SAAS,EAAE,QAAQ,CAAC;EAC7B,OAAO,EAAE,SAAS,EAAE,QAAQ,CAAC;EAC9B,CAAC,CACH;CAED,QAAQ,EAAE,SACR,EAAE,OAAO;EACP,MAAM,EAAE,SAAS,EAAE,SAAS,CAAC;EAC7B,UAAU,EAAE,SAAS,EAAqB;EAC3C,CAAC,CACH;CAED,OAAO,EAAE,OAAO;EACd,MAAM,EAAE,QAAQ;EAChB,MAAM,EAAE,SAAS,EAAE,SAAS,CAAC;EAC7B,UAAU,EAAE,SAAS,EAAoB;EAC1C,CAAC;CAEF,OAAO,EAAE,SACP,EAAE,OAAO;EACP,OAAO,EAAE,SAAS,EAAE,QAAQ,CAAC;EAC7B,UAAU,EAAE,SAAS,EAAE,SAAS,CAAC;EACjC,WAAW,EAAE,SAAS,EAAE,SAAS,CAAC;EAClC,cAAc,EAAE,SAAS,EAAE,SAAS,CAAC;EACrC,gBAAgB,EAAE,SAAS,EAA6B;EACzD,CAAC,CACH;CACD,OAAO,EAAE,SACP,EAAE,OAAO;EACP,OAAO,EAAE,SAAS,EAAE,QAAQ,CAAC;EAC7B,UAAU,EAAE,SAAS,EAAE,SAAS,CAAC;EACjC,WAAW,EAAE,SAAS,EAAE,SAAS,CAAC;EAClC,cAAc,EAAE,SAAS,EAAE,SAAS,CAAC;EACtC,CAAC,CACH;CACD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAgB,EAAE,CAAC,CAAC;CAElE,WAAW,EAAE,MAAM,CACjB,EAAE,QAAQ,EACV,EAAE,OAAO;EAAE,MAAM,EAAE,QAAQ;EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,CAAC;EAAE,CAAC,CAC9D,CAAC;CAEF,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAC;CAE/B,MAAM,EAAE,SAAS,EAAE,OAAO;EACxB,OAAO,EAAE,SAAS,EAAE,QAAQ,CAAC;EAC7B,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC;EAC/B,CAAC,CAAC;CACJ,CAAC"}
1
+ {"version":3,"file":"selection.js","names":[],"sources":["../../src/types/selection.ts"],"sourcesContent":["import { z } from 'zod';\nimport { AesRecordSchema, ColumnNameSchema, DataValueSchema, DiscreteLabelsPositionSchema, FrameTypeSchema, LegendPositionSchema, TitlePositionSchema } from './common';\n\nexport const SelectionSettingsSchema = z.object({\n type: z.literal('selection'),\n\n selectionStage: ColumnNameSchema,\n weight: z.optional(ColumnNameSchema),\n grouping: z.optional(\n z.object({\n columnName: ColumnNameSchema,\n order: z.optional(z.array(DataValueSchema)),\n inheritedAes: z.optional(AesRecordSchema),\n }),\n ),\n\n facetBy: z.optional(z.array(ColumnNameSchema)),\n facetSettings: z.optional(\n z.object({\n /** Ordered list of facet keys (e.g. \"val1_val2\"); only these facets are shown, in this order. */\n order: z.optional(z.array(z.string())),\n nRows: z.optional(z.number()),\n nCols: z.optional(z.number()),\n }),\n ),\n\n legend: z.optional(\n z.object({\n show: z.optional(z.boolean()),\n position: z.optional(LegendPositionSchema),\n }),\n ),\n\n title: z.object({\n name: z.string(),\n show: z.optional(z.boolean()),\n position: z.optional(TitlePositionSchema),\n }),\n\n xAxis: z.optional(\n z.object({\n title: z.optional(z.string()),\n showTicks: z.optional(z.boolean()),\n hiddenLabels: z.optional(z.boolean()),\n labelsPosition: z.optional(DiscreteLabelsPositionSchema),\n }),\n ),\n yAxis: z.optional(\n z.object({\n title: z.optional(z.string()),\n showGrid: z.optional(z.boolean()),\n showTicks: z.optional(z.boolean()),\n hiddenLabels: z.optional(z.boolean()),\n }),\n ),\n frame: z.optional(z.object({ type: z.optional(FrameTypeSchema) })),\n\n fillColor: z.union([\n z.string(),\n z.object({ type: z.string(), value: z.optional(z.string()) }),\n ]),\n\n opacity: z.optional(z.number()),\n\n size: z.optional(z.object({\n width: z.optional(z.number()),\n height: z.optional(z.number()),\n })),\n});\n\nexport type SelectionSettings = z.infer<typeof SelectionSettingsSchema>;\n"],"mappings":";;AAGA,MAAa,IAA0B,EAAE,OAAO;CAC9C,MAAM,EAAE,QAAQ,YAAY;CAE5B,gBAAgB;CAChB,QAAQ,EAAE,SAAS,EAAiB;CACpC,UAAU,EAAE,SACV,EAAE,OAAO;EACP,YAAY;EACZ,OAAO,EAAE,SAAS,EAAE,MAAM,EAAgB,CAAC;EAC3C,cAAc,EAAE,SAAS,EAAgB;EAC1C,CAAC,CACH;CAED,SAAS,EAAE,SAAS,EAAE,MAAM,EAAiB,CAAC;CAC9C,eAAe,EAAE,SACf,EAAE,OAAO;EAEP,OAAO,E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AAS,EAAE,QAAQ,CAAC;EAC/B,CAAC,CAAC;CACJ,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { GroupedCellsHeatmap } from '../heatmap/getCells';
2
+ import { HeatmapSettingsImpl } from '../heatmap/HeatmapSettingsImpl';
3
+ type Size = HeatmapSettingsImpl['chartSettings']['size'];
4
+ /**
5
+ * Inner (cell-area) size of a single facet.
6
+ *
7
+ * A custom cell size forces shared axes (see HeatmapSettingsImpl), so every facet is laid out
8
+ * against the GLOBAL key set (meta) in updateScales. The single shared inner size must therefore
9
+ * be derived from meta — not from one facet's (possibly partial) subset — otherwise a partially
10
+ * empty facet under-counts the keys, the inner size disagrees with the drawn cells, and facets end
11
+ * up mis-sized and overlapping. With auto cell size (null), fall back to the fixed width/height.
12
+ */
13
+ export declare function computeChartInnerSize(size: Size, meta: GroupedCellsHeatmap['meta'], groupGap: number): {
14
+ chartWidth: number;
15
+ chartHeight: number;
16
+ };
17
+ export {};
18
+ //# sourceMappingURL=computeChartInnerSize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"computeChartInnerSize.d.ts","sourceRoot":"","sources":["../../src/utils/computeChartInnerSize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAE1E,KAAK,IAAI,GAAG,mBAAmB,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAMzD;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACjC,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,mBAAmB,CAAC,MAAM,CAAC,EACjC,QAAQ,EAAE,MAAM,GACjB;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAY7C"}
@@ -0,0 +1,22 @@
1
+ function e(e, t) {
2
+ return e.filter((e) => (t[e]?.length ?? 0) > 0).length;
3
+ }
4
+ /**
5
+ * Inner (cell-area) size of a single facet.
6
+ *
7
+ * A custom cell size forces shared axes (see HeatmapSettingsImpl), so every facet is laid out
8
+ * against the GLOBAL key set (meta) in updateScales. The single shared inner size must therefore
9
+ * be derived from meta — not from one facet's (possibly partial) subset — otherwise a partially
10
+ * empty facet under-counts the keys, the inner size disagrees with the drawn cells, and facets end
11
+ * up mis-sized and overlapping. With auto cell size (null), fall back to the fixed width/height.
12
+ */
13
+ function t(t, n, r) {
14
+ let { width: i, height: a, cellWidth: o, cellHeight: s } = t;
15
+ return {
16
+ chartWidth: o && n.xKeys.length ? n.xKeys.length * o + r * (e(n.xGroupKeys, n.xKeysByGroups) - 1) : i,
17
+ chartHeight: s && n.yKeys.length ? n.yKeys.length * s + r * (e(n.yGroupKeys, n.yKeysByGroups) - 1) : a
18
+ };
19
+ }
20
+ export { t as computeChartInnerSize };
21
+
22
+ //# sourceMappingURL=computeChartInnerSize.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"computeChartInnerSize.js","names":[],"sources":["../../src/utils/computeChartInnerSize.ts"],"sourcesContent":["import type { GroupedCellsHeatmap } from '../heatmap/getCells';\nimport type { HeatmapSettingsImpl } from '../heatmap/HeatmapSettingsImpl';\n\ntype Size = HeatmapSettingsImpl['chartSettings']['size'];\n\nfunction countNonEmptyGroups(groupKeys: string[], keysByGroups: Record<string, string[]>): number {\n return groupKeys.filter(k => (keysByGroups[k]?.length ?? 0) > 0).length;\n}\n\n/**\n * Inner (cell-area) size of a single facet.\n *\n * A custom cell size forces shared axes (see HeatmapSettingsImpl), so every facet is laid out\n * against the GLOBAL key set (meta) in updateScales. The single shared inner size must therefore\n * be derived from meta — not from one facet's (possibly partial) subset — otherwise a partially\n * empty facet under-counts the keys, the inner size disagrees with the drawn cells, and facets end\n * up mis-sized and overlapping. With auto cell size (null), fall back to the fixed width/height.\n */\nexport function computeChartInnerSize(\n size: Size,\n meta: GroupedCellsHeatmap['meta'],\n groupGap: number,\n): { chartWidth: number; chartHeight: number } {\n // A defined cellWidth/cellHeight means the user picked a CUSTOM cell size, so the chart size is\n // derived from it (cellSize × key count). When null, the cell size is AUTO — the chart uses a\n // fixed width/height and the cells are stretched to fill it instead.\n const { width, height, cellWidth, cellHeight } = size;\n const chartWidth = cellWidth && meta.xKeys.length\n ? meta.xKeys.length * cellWidth + groupGap * (countNonEmptyGroups(meta.xGroupKeys, meta.xKeysByGroups) - 1)\n : width;\n const chartHeight = cellHeight && meta.yKeys.length\n ? meta.yKeys.length * cellHeight + groupGap * (countNonEmptyGroups(meta.yGroupKeys, meta.yKeysByGroups) - 1)\n : height;\n return { chartWidth, chartHeight };\n}\n"],"mappings":"AAKA,SAAS,EAAoB,GAAqB,GAAgD;AAC9F,QAAO,EAAU,QAAO,OAAM,EAAa,IAAI,UAAU,KAAK,EAAE,CAAC;;;;;;;;;;;AAYrE,SAAgB,EACZ,GACA,GACA,GAC2C;CAI3C,IAAM,EAAE,UAAO,WAAQ,cAAW,kBAAe;AAOjD,QAAO;EAAE,YANU,KAAa,EAAK,MAAM,SACrC,EAAK,MAAM,SAAS,IAAY,KAAY,EAAoB,EAAK,YAAY,EAAK,cAAc,GAAG,KACvG;EAIe,aAHD,KAAc,EAAK,MAAM,SACvC,EAAK,MAAM,SAAS,IAAa,KAAY,EAAoB,EAAK,YAAY,EAAK,cAAc,GAAG,KACxG;EAC4B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@milaboratories/miplots4",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "description": "Data visualization library",
5
5
  "author": "erohinaelena",
6
6
  "license": "ISC",