@milaboratories/miplots4 1.2.3 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/discrete/components/layers/ErrorBarElement.d.ts.map +1 -1
  2. package/dist/discrete/components/layers/ErrorBarElement.js +1 -0
  3. package/dist/discrete/components/layers/ErrorBarElement.js.map +1 -1
  4. package/dist/discrete/components/layers/LineElement.d.ts.map +1 -1
  5. package/dist/discrete/components/layers/LineElement.js +1 -0
  6. package/dist/discrete/components/layers/LineElement.js.map +1 -1
  7. package/dist/heatmap/ChartRenderer.d.ts.map +1 -1
  8. package/dist/heatmap/ChartRenderer.js +72 -78
  9. package/dist/heatmap/ChartRenderer.js.map +1 -1
  10. package/dist/scatterplot/ChartRenderer.d.ts.map +1 -1
  11. package/dist/scatterplot/ChartRenderer.js +2 -1
  12. package/dist/scatterplot/ChartRenderer.js.map +1 -1
  13. package/dist/scatterplot/ScatterplotSettingsImpl.d.ts +1 -0
  14. package/dist/scatterplot/ScatterplotSettingsImpl.d.ts.map +1 -1
  15. package/dist/scatterplot/ScatterplotSettingsImpl.js +2 -1
  16. package/dist/scatterplot/ScatterplotSettingsImpl.js.map +1 -1
  17. package/dist/scatterplot/components/ChartTrendsData.d.ts.map +1 -1
  18. package/dist/scatterplot/components/ChartTrendsData.js +2 -1
  19. package/dist/scatterplot/components/ChartTrendsData.js.map +1 -1
  20. package/dist/scatterplot/components/types.d.ts +1 -0
  21. package/dist/scatterplot/components/types.d.ts.map +1 -1
  22. package/dist/scatterplot-umap/ChartRenderer.d.ts.map +1 -1
  23. package/dist/scatterplot-umap/ChartRenderer.js +2 -0
  24. package/dist/scatterplot-umap/ChartRenderer.js.map +1 -1
  25. package/dist/scatterplot-umap/components/LowerSVG.js +1 -1
  26. package/dist/scatterplot-umap/components/LowerSVG.js.map +1 -1
  27. package/dist/scatterplot-umap/types.d.ts +1 -0
  28. package/dist/scatterplot-umap/types.d.ts.map +1 -1
  29. package/dist/types/scatterplot.d.ts +5 -0
  30. package/dist/types/scatterplot.d.ts.map +1 -1
  31. package/dist/types/scatterplot.js +2 -1
  32. package/dist/types/scatterplot.js.map +1 -1
  33. package/dist/utils/computeChartInnerSize.d.ts +18 -0
  34. package/dist/utils/computeChartInnerSize.d.ts.map +1 -0
  35. package/dist/utils/computeChartInnerSize.js +22 -0
  36. package/dist/utils/computeChartInnerSize.js.map +1 -0
  37. package/package.json +1 -1
@@ -102,7 +102,8 @@ const y = d.object({
102
102
  f,
103
103
  u(d.string())
104
104
  ]))),
105
- bounded: d.optional(d.boolean())
105
+ bounded: d.optional(d.boolean()),
106
+ lineWidth: d.optional(d.number())
106
107
  })),
107
108
  additionalCurves: d.optional(v),
108
109
  layers: d.array(h)
@@ -1 +1 @@
1
- {"version":3,"file":"scatterplot.js","names":[],"sources":["../../src/types/scatterplot.ts"],"sourcesContent":["import { z } from 'zod';\nimport type { AesItem, categoricalAesMappingFromValueSchema, Category, DataValue } from './common';\nimport {\n AesRecordSchema, AxisSettingsSchema,\n ColumnNameSchema,\n continuousAesMappingFromValueSchema, DataValueSchema,\n FrameTypeSchema,\n LegendPositionSchema,\n LineShapeSchema,\n PointShapeSchema,\n TitlePositionSchema,\n TooltipSettingsSchema,\n} from './common';\n\ntype catAesFromColumn<ValueType extends z.ZodType> = ReturnType<typeof categoricalAesMappingFromValueSchema<ValueType>>;\ntype contAesFromColumn<ValueType extends z.ZodType> = ReturnType<typeof continuousAesMappingFromValueSchema<ValueType>>;\n\nexport type CategoricalAesFromColumn<ValueType> = z.infer<catAesFromColumn<z.ZodType<ValueType>>>;\nexport type ContinuousAesFromColumn<ValueType> = z.infer<contAesFromColumn<z.ZodType<ValueType>>>;\n\nconst InheritAesSchema = z.object({\n type: z.literal('grouping'),\n value: z.string(), // link to aes mapped to column\n palette: z.optional(z.array(z.string())) // if defined we use palette to create mapping without inheritedAes field\n});\nexport type InheritAesScatterplot = z.infer<typeof InheritAesSchema>;\n\nconst DotsLayerSchema = z.object({\n type: z.literal('dots'),\n aes: z.optional(\n z.object({\n dotFill: z.optional(z.union([z.string(), InheritAesSchema, continuousAesMappingFromValueSchema(z.string())])),\n dotShape: z.optional(z.union([PointShapeSchema, InheritAesSchema])),\n dotSize: z.optional(z.union([z.number(), continuousAesMappingFromValueSchema(z.number())])),\n })\n ),\n});\nconst CurveLayerSchema = z.object({\n type: z.literal('curve'),\n smoothing: z.optional(z.boolean()),\n aes: z.optional(\n z.object({\n lineWidth: z.optional(z.number()),\n lineShape: z.optional(LineShapeSchema),\n lineColor: z.optional(z.union([z.string(), InheritAesSchema, continuousAesMappingFromValueSchema(z.string())])),\n opacity: z.optional(z.number()),\n })\n ),\n});\nconst ScatterplotLayerSchema = z.union([DotsLayerSchema, CurveLayerSchema]);\n\nexport type DotsLayer = z.infer<typeof DotsLayerSchema>;\nexport type CurveLayer = z.infer<typeof CurveLayerSchema>;\nexport type ScatterplotLayer = z.infer<typeof ScatterplotLayerSchema>;\n\nconst AdditionalCurveTrendSchema = z.object({\n color: z.optional(z.union([z.string(), InheritAesSchema, continuousAesMappingFromValueSchema(z.string())])),\n bounded: z.optional(z.boolean()),\n});\n\nconst AdditionalCurveEntrySchema = z.object({\n columnName: ColumnNameSchema,\n label: z.string(),\n lineShape: z.optional(LineShapeSchema),\n lineWidth: z.optional(z.number()),\n lineColor: z.optional(z.union([z.string(), InheritAesSchema, continuousAesMappingFromValueSchema(z.string())])),\n opacity: z.optional(z.number()),\n showDots: z.optional(z.boolean()),\n // When present, suppresses the curve polyline and renders a linear trend instead. Dots (showDots) are unaffected.\n trend: z.optional(AdditionalCurveTrendSchema),\n});\n\nconst AdditionalCurvesSchema = z.object({\n curves: z.array(AdditionalCurveEntrySchema),\n smoothing: z.optional(z.boolean()),\n});\n\nexport type AdditionalCurveTrend = z.infer<typeof AdditionalCurveTrendSchema>;\nexport type AdditionalCurveEntry = z.infer<typeof AdditionalCurveEntrySchema>;\nexport type AdditionalCurves = z.infer<typeof AdditionalCurvesSchema>;\n\nexport const ScatterplotSettingsSchema = z.object({\n type: z.literal('scatterplot'),\n title: z.object({\n name: z.string(),\n show: z.optional(z.boolean()),\n position: z.optional(TitlePositionSchema),\n }),\n size: z.optional(\n z.object({\n width: z.optional(z.number()),\n height: z.optional(z.number()),\n })\n ),\n legend: z.optional(\n z.object({\n show: z.optional(z.boolean()),\n position: z.optional(LegendPositionSchema),\n })\n ),\n tooltips: z.optional(TooltipSettingsSchema),\n frame: z.optional(z.object({type: z.optional(FrameTypeSchema)})),\n facetSettings: z.optional(\n z.object({\n sharedX: z.optional(z.boolean()),\n sharedY: z.optional(z.boolean()),\n /** Ordered list of facet keys; 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 keyColumn: ColumnNameSchema,\n x: ColumnNameSchema,\n y: ColumnNameSchema,\n xAxis: z.optional(AxisSettingsSchema),\n yAxis: z.optional(AxisSettingsSchema),\n grouping: z.optional(z.array(\n z.object({\n columnName: ColumnNameSchema,\n order: z.optional(z.array(DataValueSchema)),\n inheritedAes: z.optional(AesRecordSchema),\n allowNullGroup: z.optional(z.boolean())\n })\n )),\n dotSize: z.optional(z.array(\n z.object({\n columnName: ColumnNameSchema,\n })\n )),\n dotShape: z.optional(z.array(\n z.object({\n columnName: ColumnNameSchema,\n order: z.optional(z.array(DataValueSchema)),\n inheritedAes: z.optional(AesRecordSchema),\n })\n )),\n facetBy: z.optional(z.array(ColumnNameSchema)),\n label: z.optional(ColumnNameSchema),\n highlight: z.optional(ColumnNameSchema),\n trend: z.optional(\n z.object({\n color: z.optional(z.optional(z.union([z.string(), InheritAesSchema, continuousAesMappingFromValueSchema(z.string())]))),\n bounded: z.optional(z.boolean()), // if true: line and area bounded with min and max X value; else line bounded by chart bounds\n })\n ),\n additionalCurves: z.optional(AdditionalCurvesSchema),\n layers: z.array(ScatterplotLayerSchema),\n});\n\nexport type ScatterplotSettings = z.infer<typeof ScatterplotSettingsSchema>;\n\nexport type ScatterplotLegendInfo = Record<\n string,\n {\n values: Category[];\n usedAes: (keyof AesItem)[];\n aesMap: (value: Category, field: keyof AesItem) => undefined | DataValue;\n labels: Record<Category, string>;\n }\n>;\n"],"mappings":";;AAoBA,IAAM,IAAmB,EAAE,OAAO;CAC9B,MAAM,EAAE,QAAQ,WAAW;CAC3B,OAAO,EAAE,QAAQ;CACjB,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;CAC3C,CAAC,EAGI,IAAkB,EAAE,OAAO;CAC7B,MAAM,EAAE,QAAQ,OAAO;CACvB,KAAK,EAAE,SACH,EAAE,OAAO;EACL,SAAS,EAAE,SAAS,EAAE,MAAM;GAAC,EAAE,QAAQ;GAAE;GAAkB,EAAoC,EAAE,QAAQ,CAAC;GAAC,CAAC,CAAC;EAC7G,UAAU,EAAE,SAAS,EAAE,MAAM,CAAC,GAAkB,EAAiB,CAAC,CAAC;EACnE,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,EAAoC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;EAC9F,CAAC,CACL;CACJ,CAAC,EACI,IAAmB,EAAE,OAAO;CAC9B,MAAM,EAAE,QAAQ,QAAQ;CACxB,WAAW,EAAE,SAAS,EAAE,SAAS,CAAC;CAClC,KAAK,EAAE,SACH,EAAE,OAAO;EACL,WAAW,EAAE,SAAS,EAAE,QAAQ,CAAC;EACjC,WAAW,EAAE,SAAS,EAAgB;EACtC,WAAW,EAAE,SAAS,EAAE,MAAM;GAAC,EAAE,QAAQ;GAAE;GAAkB,EAAoC,EAAE,QAAQ,CAAC;GAAC,CAAC,CAAC;EAC/G,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAC;EAClC,CAAC,CACL;CACJ,CAAC,EACI,IAAyB,EAAE,MAAM,CAAC,GAAiB,EAAiB,CAAC,EAMrE,IAA6B,EAAE,OAAO;CACxC,OAAO,EAAE,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AC1C,CAAC"}
1
+ {"version":3,"file":"scatterplot.js","names":[],"sources":["../../src/types/scatterplot.ts"],"sourcesContent":["import { z } from 'zod';\nimport type { AesItem, categoricalAesMappingFromValueSchema, Category, DataValue } from './common';\nimport {\n AesRecordSchema, AxisSettingsSchema,\n ColumnNameSchema,\n continuousAesMappingFromValueSchema, DataValueSchema,\n FrameTypeSchema,\n LegendPositionSchema,\n LineShapeSchema,\n PointShapeSchema,\n TitlePositionSchema,\n TooltipSettingsSchema,\n} from './common';\n\ntype catAesFromColumn<ValueType extends z.ZodType> = ReturnType<typeof categoricalAesMappingFromValueSchema<ValueType>>;\ntype contAesFromColumn<ValueType extends z.ZodType> = ReturnType<typeof continuousAesMappingFromValueSchema<ValueType>>;\n\nexport type CategoricalAesFromColumn<ValueType> = z.infer<catAesFromColumn<z.ZodType<ValueType>>>;\nexport type ContinuousAesFromColumn<ValueType> = z.infer<contAesFromColumn<z.ZodType<ValueType>>>;\n\nconst InheritAesSchema = z.object({\n type: z.literal('grouping'),\n value: z.string(), // link to aes mapped to column\n palette: z.optional(z.array(z.string())) // if defined we use palette to create mapping without inheritedAes field\n});\nexport type InheritAesScatterplot = z.infer<typeof InheritAesSchema>;\n\nconst DotsLayerSchema = z.object({\n type: z.literal('dots'),\n aes: z.optional(\n z.object({\n dotFill: z.optional(z.union([z.string(), InheritAesSchema, continuousAesMappingFromValueSchema(z.string())])),\n dotShape: z.optional(z.union([PointShapeSchema, InheritAesSchema])),\n dotSize: z.optional(z.union([z.number(), continuousAesMappingFromValueSchema(z.number())])),\n })\n ),\n});\nconst CurveLayerSchema = z.object({\n type: z.literal('curve'),\n smoothing: z.optional(z.boolean()),\n aes: z.optional(\n z.object({\n lineWidth: z.optional(z.number()),\n lineShape: z.optional(LineShapeSchema),\n lineColor: z.optional(z.union([z.string(), InheritAesSchema, continuousAesMappingFromValueSchema(z.string())])),\n opacity: z.optional(z.number()),\n })\n ),\n});\nconst ScatterplotLayerSchema = z.union([DotsLayerSchema, CurveLayerSchema]);\n\nexport type DotsLayer = z.infer<typeof DotsLayerSchema>;\nexport type CurveLayer = z.infer<typeof CurveLayerSchema>;\nexport type ScatterplotLayer = z.infer<typeof ScatterplotLayerSchema>;\n\nconst AdditionalCurveTrendSchema = z.object({\n color: z.optional(z.union([z.string(), InheritAesSchema, continuousAesMappingFromValueSchema(z.string())])),\n bounded: z.optional(z.boolean()),\n});\n\nconst AdditionalCurveEntrySchema = z.object({\n columnName: ColumnNameSchema,\n label: z.string(),\n lineShape: z.optional(LineShapeSchema),\n lineWidth: z.optional(z.number()),\n lineColor: z.optional(z.union([z.string(), InheritAesSchema, continuousAesMappingFromValueSchema(z.string())])),\n opacity: z.optional(z.number()),\n showDots: z.optional(z.boolean()),\n // When present, suppresses the curve polyline and renders a linear trend instead. Dots (showDots) are unaffected.\n trend: z.optional(AdditionalCurveTrendSchema),\n});\n\nconst AdditionalCurvesSchema = z.object({\n curves: z.array(AdditionalCurveEntrySchema),\n smoothing: z.optional(z.boolean()),\n});\n\nexport type AdditionalCurveTrend = z.infer<typeof AdditionalCurveTrendSchema>;\nexport type AdditionalCurveEntry = z.infer<typeof AdditionalCurveEntrySchema>;\nexport type AdditionalCurves = z.infer<typeof AdditionalCurvesSchema>;\n\nexport const ScatterplotSettingsSchema = z.object({\n type: z.literal('scatterplot'),\n title: z.object({\n name: z.string(),\n show: z.optional(z.boolean()),\n position: z.optional(TitlePositionSchema),\n }),\n size: z.optional(\n z.object({\n width: z.optional(z.number()),\n height: z.optional(z.number()),\n })\n ),\n legend: z.optional(\n z.object({\n show: z.optional(z.boolean()),\n position: z.optional(LegendPositionSchema),\n })\n ),\n tooltips: z.optional(TooltipSettingsSchema),\n frame: z.optional(z.object({type: z.optional(FrameTypeSchema)})),\n facetSettings: z.optional(\n z.object({\n sharedX: z.optional(z.boolean()),\n sharedY: z.optional(z.boolean()),\n /** Ordered list of facet keys; 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 keyColumn: ColumnNameSchema,\n x: ColumnNameSchema,\n y: ColumnNameSchema,\n xAxis: z.optional(AxisSettingsSchema),\n yAxis: z.optional(AxisSettingsSchema),\n grouping: z.optional(z.array(\n z.object({\n columnName: ColumnNameSchema,\n order: z.optional(z.array(DataValueSchema)),\n inheritedAes: z.optional(AesRecordSchema),\n allowNullGroup: z.optional(z.boolean())\n })\n )),\n dotSize: z.optional(z.array(\n z.object({\n columnName: ColumnNameSchema,\n })\n )),\n dotShape: z.optional(z.array(\n z.object({\n columnName: ColumnNameSchema,\n order: z.optional(z.array(DataValueSchema)),\n inheritedAes: z.optional(AesRecordSchema),\n })\n )),\n facetBy: z.optional(z.array(ColumnNameSchema)),\n label: z.optional(ColumnNameSchema),\n highlight: z.optional(ColumnNameSchema),\n trend: z.optional(\n z.object({\n color: z.optional(z.optional(z.union([z.string(), InheritAesSchema, continuousAesMappingFromValueSchema(z.string())]))),\n bounded: z.optional(z.boolean()), // if true: line and area bounded with min and max X value; else line bounded by chart bounds\n lineWidth: z.optional(z.number()),\n })\n ),\n additionalCurves: z.optional(AdditionalCurvesSchema),\n layers: z.array(ScatterplotLayerSchema),\n});\n\nexport type ScatterplotSettings = z.infer<typeof ScatterplotSettingsSchema>;\n\nexport type ScatterplotLegendInfo = Record<\n string,\n {\n values: Category[];\n usedAes: (keyof AesItem)[];\n aesMap: (value: Category, field: keyof AesItem) => undefined | DataValue;\n labels: Record<Category, string>;\n }\n>;\n"],"mappings":";;AAoBA,IAAM,IAAmB,EAAE,OAAO;CAC9B,MAAM,EAAE,QAAQ,WAAW;CAC3B,OAAO,EAAE,QAAQ;CACjB,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;CAC3C,CAAC,EAGI,IAAkB,EAAE,OAAO;CAC7B,MAAM,EAAE,QAAQ,OAAO;CACvB,KAAK,EAAE,SACH,EAAE,OAAO;EACL,SAAS,EAAE,SAAS,EAAE,MAAM;GAA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AE,MAAM,EAAgB,CAAC;EAC3C,cAAc,EAAE,SAAS,EAAgB;EACzC,gBAAgB,EAAE,SAAS,EAAE,SAAS,CAAC;EAC1C,CAAC,CACL,CAAC;CACF,SAAS,EAAE,SAAS,EAAE,MAClB,EAAE,OAAO,EACL,YAAY,GACf,CAAC,CACL,CAAC;CACF,UAAU,EAAE,SAAS,EAAE,MACnB,EAAE,OAAO;EACL,YAAY;EACZ,OAAO,EAAE,SAAS,EAAE,MAAM,EAAgB,CAAC;EAC3C,cAAc,EAAE,SAAS,EAAgB;EAC5C,CAAC,CACL,CAAC;CACF,SAAS,EAAE,SAAS,EAAE,MAAM,EAAiB,CAAC;CAC9C,OAAO,EAAE,SAAS,EAAiB;CACnC,WAAW,EAAE,SAAS,EAAiB;CACvC,OAAO,EAAE,SACL,EAAE,OAAO;EACL,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM;GAAC,EAAE,QAAQ;GAAE;GAAkB,EAAoC,EAAE,QAAQ,CAAC;GAAC,CAAC,CAAC,CAAC;EACvH,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC;EAChC,WAAW,EAAE,SAAS,EAAE,QAAQ,CAAC;EACpC,CAAC,CACL;CACD,kBAAkB,EAAE,SAAS,EAAuB;CACpD,QAAQ,EAAE,MAAM,EAAuB;CAC1C,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.3",
3
+ "version": "1.3.0",
4
4
  "description": "Data visualization library",
5
5
  "author": "erohinaelena",
6
6
  "license": "ISC",