vizmatic 0.1.38 → 0.1.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -69,6 +69,7 @@ __export(index_exports, {
69
69
  MetricCard: () => MetricCard,
70
70
  MiniBarChart: () => MiniBarChart,
71
71
  Panel: () => Panel,
72
+ ParetoChart: () => ParetoChart,
72
73
  Pipeline: () => Pipeline,
73
74
  ProgressList: () => ProgressList,
74
75
  ProgressRow: () => ProgressRow,
@@ -5912,6 +5913,225 @@ function ScatterPlot({
5912
5913
  )
5913
5914
  });
5914
5915
  }
5916
+ function pointDominates(candidate, point, xObjective, yObjective) {
5917
+ const xNoWorse = xObjective === "minimize" ? candidate.x <= point.x : candidate.x >= point.x;
5918
+ const yNoWorse = yObjective === "minimize" ? candidate.y <= point.y : candidate.y >= point.y;
5919
+ const xBetter = xObjective === "minimize" ? candidate.x < point.x : candidate.x > point.x;
5920
+ const yBetter = yObjective === "minimize" ? candidate.y < point.y : candidate.y > point.y;
5921
+ return xNoWorse && yNoWorse && (xBetter || yBetter);
5922
+ }
5923
+ function paretoFrontierIndices(points, xObjective, yObjective) {
5924
+ const frontier = /* @__PURE__ */ new Set();
5925
+ for (const candidate of points) {
5926
+ const dominated = points.some(({ point }) => pointDominates(point, candidate.point, xObjective, yObjective));
5927
+ if (!dominated) frontier.add(candidate.index);
5928
+ }
5929
+ return frontier;
5930
+ }
5931
+ function positiveLogDomain(values, min, max) {
5932
+ const positiveValues = values.filter((value) => Number.isFinite(value) && value > 0);
5933
+ const positiveMin = min !== void 0 && Number.isFinite(min) && min > 0 ? min : Math.min(...positiveValues, 1);
5934
+ const fallbackMax = Math.max(...positiveValues, positiveMin * 10);
5935
+ const positiveMax = max !== void 0 && Number.isFinite(max) && max > 0 ? max : fallbackMax;
5936
+ const safeMin = Math.max(Number.MIN_VALUE, positiveMin);
5937
+ const safeMax = positiveMax > safeMin ? positiveMax : safeMin * 10;
5938
+ return { min: safeMin, max: safeMax, range: Math.log(safeMax) - Math.log(safeMin) };
5939
+ }
5940
+ function logChartTicks(min, max, count = 5) {
5941
+ if (!(min > 0) || !(max > min) || count <= 1) return [min];
5942
+ const startPower = Math.ceil(Math.log10(min));
5943
+ const endPower = Math.floor(Math.log10(max));
5944
+ const powers = Array.from({ length: Math.max(0, endPower - startPower + 1) }, (_, index) => 10 ** (startPower + index)).filter((value) => value >= min && value <= max);
5945
+ if (powers.length >= 4) return powers;
5946
+ return Array.from({ length: count }, (_, index) => min * (max / min) ** (index / (count - 1)));
5947
+ }
5948
+ function ParetoChart({
5949
+ points,
5950
+ c,
5951
+ title,
5952
+ subtitle,
5953
+ width = 640,
5954
+ height = 360,
5955
+ xMin,
5956
+ xMax,
5957
+ yMin,
5958
+ yMax,
5959
+ xAxisLabel,
5960
+ yAxisLabel,
5961
+ formatX = "decimal",
5962
+ formatY = "decimal",
5963
+ showGrid = true,
5964
+ xScale = "linear",
5965
+ xObjective = "minimize",
5966
+ yObjective = "maximize",
5967
+ frontierColor,
5968
+ showGoal = true,
5969
+ goalLabel,
5970
+ footer
5971
+ }) {
5972
+ const margin = { top: 22, right: 26, bottom: xAxisLabel ? 48 : 36, left: yAxisLabel ? 56 : 44 };
5973
+ const plot = createPlotArea(width, height, margin);
5974
+ const validPoints = points.map((point, index) => ({ point, index })).filter(({ point }) => Number.isFinite(point.x) && Number.isFinite(point.y) && (xScale !== "log" || point.x > 0));
5975
+ const frontierIndices = paretoFrontierIndices(validPoints, xObjective, yObjective);
5976
+ const xDomain = xScale === "log" ? positiveLogDomain(validPoints.map(({ point }) => point.x), xMin, xMax) : chartDomain(validPoints.map(({ point }) => point.x), xMin, xMax);
5977
+ const yDomain = chartDomain(validPoints.map(({ point }) => point.y), yMin, yMax);
5978
+ const xTicks = xScale === "log" ? logChartTicks(xDomain.min, xDomain.max) : chartTicks(xDomain.min, xDomain.max, 5);
5979
+ const yTicks = chartTicks(yDomain.min, yDomain.max, 5);
5980
+ const frontier = chartColor(frontierColor ?? "positive", c, 0);
5981
+ const pointFor = (xValue, yValue) => {
5982
+ const x = xScale === "log" ? plot.x + (Math.log(xValue > 0 ? xValue : xDomain.min) - Math.log(xDomain.min)) / xDomain.range * plot.innerWidth : xInPlot(xValue, xDomain, plot);
5983
+ return {
5984
+ x: clamp(x, plot.x, plot.right),
5985
+ y: clamp(yInPlot(yValue, yDomain, plot), plot.y, plot.bottom)
5986
+ };
5987
+ };
5988
+ const pointGeometries = validPoints.map(({ point, index }) => {
5989
+ const pointPosition = pointFor(point.x, point.y);
5990
+ const isFrontier = frontierIndices.has(index);
5991
+ return {
5992
+ point,
5993
+ index,
5994
+ x: pointPosition.x,
5995
+ y: pointPosition.y,
5996
+ color: chartColor(point.color ?? (isFrontier ? frontier : "neutral"), c, index),
5997
+ frontier: isFrontier
5998
+ };
5999
+ });
6000
+ const frontierGeometries = pointGeometries.filter((geometry) => geometry.frontier).sort((left, right) => left.point.x - right.point.x);
6001
+ const frontierPath = frontierGeometries.length > 1 ? frontierGeometries.map((geometry, index) => `${index === 0 ? "M" : "L"} ${geometry.x.toFixed(1)} ${geometry.y.toFixed(1)}`).join(" ") : void 0;
6002
+ const goalText = goalLabel ?? `goal: ${xObjective === "minimize" ? "lower x" : "higher x"} \xB7 ${yObjective === "maximize" ? "higher y" : "lower y"}`;
6003
+ const goalXStart = plot.right - 72;
6004
+ const goalY = plot.y + 18;
6005
+ const goalXEnd = xObjective === "minimize" ? goalXStart - 26 : goalXStart + 26;
6006
+ const goalYStart = plot.y + 52;
6007
+ const goalYEnd = yObjective === "maximize" ? goalYStart - 26 : goalYStart + 26;
6008
+ const arrowSize = 5;
6009
+ return ChartFrame({
6010
+ c,
6011
+ title,
6012
+ subtitle,
6013
+ width,
6014
+ footer,
6015
+ legend: [
6016
+ { label: "Pareto frontier", color: frontier },
6017
+ { label: "dominated", color: "neutral" }
6018
+ ],
6019
+ children: import_react9.default.createElement(
6020
+ "div",
6021
+ { style: { position: "relative", width, height, display: "flex" } },
6022
+ import_react9.default.createElement(
6023
+ "svg",
6024
+ { width, height, viewBox: `0 0 ${width} ${height}` },
6025
+ showGrid && import_react9.default.createElement(
6026
+ "g",
6027
+ {},
6028
+ ...xTicks.map((tick) => {
6029
+ const x = pointFor(tick, yDomain.min).x;
6030
+ return import_react9.default.createElement("line", {
6031
+ key: `pareto-x-grid-${tick}`,
6032
+ x1: x,
6033
+ y1: plot.y,
6034
+ x2: x,
6035
+ y2: plot.bottom,
6036
+ stroke: c.borderSubtle,
6037
+ strokeWidth: 1
6038
+ });
6039
+ }),
6040
+ ...yTicks.map((tick) => {
6041
+ const y = yInPlot(tick, yDomain, plot);
6042
+ return import_react9.default.createElement("line", {
6043
+ key: `pareto-y-grid-${tick}`,
6044
+ x1: plot.x,
6045
+ y1: y,
6046
+ x2: plot.right,
6047
+ y2: y,
6048
+ stroke: c.borderSubtle,
6049
+ strokeWidth: 1
6050
+ });
6051
+ })
6052
+ ),
6053
+ import_react9.default.createElement("rect", {
6054
+ x: plot.x,
6055
+ y: plot.y,
6056
+ width: plot.innerWidth,
6057
+ height: plot.innerHeight,
6058
+ fill: "transparent",
6059
+ stroke: c.borderLight,
6060
+ strokeWidth: 1.2,
6061
+ rx: 6
6062
+ }),
6063
+ showGoal && import_react9.default.createElement(
6064
+ "g",
6065
+ { "data-pareto-goal": true, stroke: frontier, fill: "none", strokeWidth: 2, strokeLinecap: "round" },
6066
+ import_react9.default.createElement("line", { x1: goalXStart, y1: goalY, x2: goalXEnd, y2: goalY }),
6067
+ import_react9.default.createElement("line", { x1: goalXEnd, y1: goalY, x2: goalXEnd + (xObjective === "minimize" ? arrowSize : -arrowSize), y2: goalY - arrowSize }),
6068
+ import_react9.default.createElement("line", { x1: goalXEnd, y1: goalY, x2: goalXEnd + (xObjective === "minimize" ? arrowSize : -arrowSize), y2: goalY + arrowSize }),
6069
+ import_react9.default.createElement("line", { x1: goalXStart, y1: goalYStart, x2: goalXStart, y2: goalYEnd }),
6070
+ import_react9.default.createElement("line", { x1: goalXStart, y1: goalYEnd, x2: goalXStart - arrowSize, y2: goalYEnd + (yObjective === "maximize" ? arrowSize : -arrowSize) }),
6071
+ import_react9.default.createElement("line", { x1: goalXStart, y1: goalYEnd, x2: goalXStart + arrowSize, y2: goalYEnd + (yObjective === "maximize" ? arrowSize : -arrowSize) })
6072
+ ),
6073
+ frontierPath && import_react9.default.createElement("path", {
6074
+ "data-pareto-frontier": true,
6075
+ d: frontierPath,
6076
+ fill: "none",
6077
+ stroke: frontier,
6078
+ strokeWidth: 3,
6079
+ strokeLinecap: "round",
6080
+ strokeLinejoin: "round"
6081
+ }),
6082
+ ...pointGeometries.filter((geometry) => !geometry.frontier).concat(pointGeometries.filter((geometry) => geometry.frontier)).map(({ point, index, x, y, color, frontier: isFrontier }) => import_react9.default.createElement("circle", {
6083
+ key: `pareto-point-${point.label ?? "point"}-${index}`,
6084
+ "data-pareto-status": isFrontier ? "frontier" : "dominated",
6085
+ cx: x,
6086
+ cy: y,
6087
+ r: Math.max(4, Math.min(20, point.size ?? (isFrontier ? 8 : 7))),
6088
+ fill: color,
6089
+ opacity: isFrontier ? 1 : 0.38,
6090
+ stroke: isFrontier ? frontier : c.bgCard,
6091
+ strokeWidth: isFrontier ? 3 : 2
6092
+ }))
6093
+ ),
6094
+ ...xTicks.map((tick) => {
6095
+ const x = pointFor(tick, yDomain.min).x;
6096
+ return chartLabel(`pareto-x-tick-${tick}`, formatChartValue(tick, formatX), x, plot.bottom + 18, c, { width: 52 });
6097
+ }),
6098
+ ...yTicks.map((tick) => {
6099
+ const y = yInPlot(tick, yDomain, plot);
6100
+ return chartLabel(`pareto-y-tick-${tick}`, formatChartValue(tick, formatY), plot.x - 8, y, c, { align: "right", width: 42 });
6101
+ }),
6102
+ showGoal && chartLabel("pareto-goal-label", goalText, plot.right - 2, plot.y + 9, c, {
6103
+ align: "right",
6104
+ width: 170,
6105
+ color: frontier,
6106
+ fontWeight: 850,
6107
+ fontSize: 11,
6108
+ bounds: { x: plot.x, y: plot.y, width: plot.innerWidth, height: plot.innerHeight, padding: 4 }
6109
+ }),
6110
+ xAxisLabel && chartLabel("pareto-x-axis-label", xAxisLabel, plot.x + plot.innerWidth / 2, height - 8, c, {
6111
+ width: plot.innerWidth,
6112
+ fontFamily: "Inter",
6113
+ fontWeight: 700
6114
+ }),
6115
+ yAxisLabel && chartLabel("pareto-y-axis-label", yAxisLabel, 12, plot.y + plot.innerHeight / 2, c, {
6116
+ width: plot.innerHeight,
6117
+ fontFamily: "Inter",
6118
+ fontWeight: 700,
6119
+ transform: "translate(-50%, -50%) rotate(-90deg)"
6120
+ }),
6121
+ ...pointGeometries.flatMap(({ point, index, x, y, color, frontier: isFrontier }) => {
6122
+ if (!point.label) return [];
6123
+ const placement = pointLabelPlacement(x, y, plot, index, 110);
6124
+ return [chartLabel(`pareto-point-label-${index}`, point.label, placement.x, placement.y, c, {
6125
+ align: placement.align,
6126
+ width: placement.width,
6127
+ bounds: placement.bounds,
6128
+ color: isFrontier ? color : c.textMuted,
6129
+ fontWeight: isFrontier ? 850 : 600
6130
+ })];
6131
+ })
6132
+ )
6133
+ });
6134
+ }
5915
6135
  function QuadrantChart({
5916
6136
  points,
5917
6137
  regions,
@@ -5920,27 +6140,46 @@ function QuadrantChart({
5920
6140
  subtitle,
5921
6141
  width = 700,
5922
6142
  height = 360,
6143
+ xMin,
6144
+ xMax,
6145
+ yMin,
6146
+ yMax,
6147
+ xThreshold,
6148
+ yThreshold,
5923
6149
  xAxisLabel,
5924
6150
  yAxisLabel,
6151
+ formatX = "decimal",
6152
+ formatY = "decimal",
6153
+ showTicks = false,
6154
+ showGrid = false,
5925
6155
  footer
5926
6156
  }) {
5927
- const margin = { top: 18, right: 20, bottom: xAxisLabel ? 46 : 24, left: yAxisLabel ? 54 : 24 };
6157
+ const margin = {
6158
+ top: 18,
6159
+ right: 20,
6160
+ bottom: xAxisLabel ? showTicks ? 58 : 46 : showTicks ? 36 : 24,
6161
+ left: yAxisLabel ? showTicks ? 72 : 54 : showTicks ? 48 : 24
6162
+ };
5928
6163
  const plot = createPlotArea(width, height, margin);
5929
- const halfWidth = plot.innerWidth / 2;
5930
- const halfHeight = plot.innerHeight / 2;
5931
- const midX = plot.x + halfWidth;
5932
- const midY = plot.y + halfHeight;
6164
+ const xDomain = xMin === void 0 && xMax === void 0 ? { min: 0, max: 1, range: 1 } : chartDomain(points.map((point) => point.x), xMin, xMax);
6165
+ const yDomain = yMin === void 0 && yMax === void 0 ? { min: 0, max: 1, range: 1 } : chartDomain(points.map((point) => point.y), yMin, yMax);
6166
+ const resolvedXThreshold = clamp(xThreshold ?? xDomain.min + xDomain.range / 2, xDomain.min, xDomain.max);
6167
+ const resolvedYThreshold = clamp(yThreshold ?? yDomain.min + yDomain.range / 2, yDomain.min, yDomain.max);
6168
+ const midX = xInPlot(resolvedXThreshold, xDomain, plot);
6169
+ const midY = yInPlot(resolvedYThreshold, yDomain, plot);
6170
+ const xTicks = showTicks || showGrid ? chartTicks(xDomain.min, xDomain.max, 5) : [];
6171
+ const yTicks = showTicks || showGrid ? chartTicks(yDomain.min, yDomain.max, 5) : [];
5933
6172
  const regionEntries = [
5934
- { key: "top-left", region: regions.topLeft, x: plot.x, y: plot.y },
5935
- { key: "top-right", region: regions.topRight, x: midX, y: plot.y },
5936
- { key: "bottom-left", region: regions.bottomLeft, x: plot.x, y: midY },
5937
- { key: "bottom-right", region: regions.bottomRight, x: midX, y: midY }
6173
+ { key: "top-left", region: regions.topLeft, x: plot.x, y: plot.y, width: midX - plot.x, height: midY - plot.y },
6174
+ { key: "top-right", region: regions.topRight, x: midX, y: plot.y, width: plot.right - midX, height: midY - plot.y },
6175
+ { key: "bottom-left", region: regions.bottomLeft, x: plot.x, y: midY, width: midX - plot.x, height: plot.bottom - midY },
6176
+ { key: "bottom-right", region: regions.bottomRight, x: midX, y: midY, width: plot.right - midX, height: plot.bottom - midY }
5938
6177
  ];
5939
6178
  const pointGeometries = points.map((point, index) => ({
5940
6179
  point,
5941
6180
  index,
5942
- x: plot.x + clamp(point.x, 0, 1) * plot.innerWidth,
5943
- y: plot.y + plot.innerHeight - clamp(point.y, 0, 1) * plot.innerHeight,
6181
+ x: xInPlot(clamp(point.x, xDomain.min, xDomain.max), xDomain, plot),
6182
+ y: yInPlot(clamp(point.y, yDomain.min, yDomain.max), yDomain, plot),
5944
6183
  color: chartColor(point.color, c, index)
5945
6184
  }));
5946
6185
  return ChartFrame({
@@ -5957,15 +6196,49 @@ function QuadrantChart({
5957
6196
  import_react9.default.createElement(
5958
6197
  "svg",
5959
6198
  { width, height, viewBox: `0 0 ${width} ${height}` },
5960
- ...regionEntries.map(({ key, region, x, y }, index) => import_react9.default.createElement("rect", {
5961
- key: `quadrant-${key}`,
5962
- x,
5963
- y,
5964
- width: halfWidth,
5965
- height: halfHeight,
5966
- fill: chartColor(region.color, c, index),
5967
- opacity: 0.1
5968
- })),
6199
+ ...regionEntries.map(({ key, region, x, y, width: regionWidth, height: regionHeight }, index) => {
6200
+ const color = chartColor(region.color, c, index);
6201
+ const emphasized = region.emphasis === true;
6202
+ return import_react9.default.createElement("rect", {
6203
+ key: `quadrant-${key}`,
6204
+ x,
6205
+ y,
6206
+ width: regionWidth,
6207
+ height: regionHeight,
6208
+ fill: color,
6209
+ opacity: emphasized ? 0.2 : 0.1,
6210
+ stroke: emphasized ? color : "transparent",
6211
+ strokeWidth: emphasized ? 2 : 0
6212
+ });
6213
+ }),
6214
+ showGrid && import_react9.default.createElement(
6215
+ "g",
6216
+ {},
6217
+ ...xTicks.map((tick) => {
6218
+ const x = xInPlot(tick, xDomain, plot);
6219
+ return import_react9.default.createElement("line", {
6220
+ key: `quadrant-x-grid-${tick}`,
6221
+ x1: x,
6222
+ y1: plot.y,
6223
+ x2: x,
6224
+ y2: plot.bottom,
6225
+ stroke: c.borderSubtle,
6226
+ strokeWidth: 1
6227
+ });
6228
+ }),
6229
+ ...yTicks.map((tick) => {
6230
+ const y = yInPlot(tick, yDomain, plot);
6231
+ return import_react9.default.createElement("line", {
6232
+ key: `quadrant-y-grid-${tick}`,
6233
+ x1: plot.x,
6234
+ y1: y,
6235
+ x2: plot.right,
6236
+ y2: y,
6237
+ stroke: c.borderSubtle,
6238
+ strokeWidth: 1
6239
+ });
6240
+ })
6241
+ ),
5969
6242
  import_react9.default.createElement("rect", {
5970
6243
  x: plot.x,
5971
6244
  y: plot.y,
@@ -5992,6 +6265,30 @@ function QuadrantChart({
5992
6265
  stroke: c.borderLight,
5993
6266
  strokeWidth: 1.4
5994
6267
  }),
6268
+ ...(showTicks ? xTicks : []).map((tick) => {
6269
+ const x = xInPlot(tick, xDomain, plot);
6270
+ return import_react9.default.createElement("line", {
6271
+ key: `quadrant-x-tick-${tick}`,
6272
+ x1: x,
6273
+ y1: plot.bottom,
6274
+ x2: x,
6275
+ y2: plot.bottom + 5,
6276
+ stroke: c.textMuted,
6277
+ strokeWidth: 1.2
6278
+ });
6279
+ }),
6280
+ ...(showTicks ? yTicks : []).map((tick) => {
6281
+ const y = yInPlot(tick, yDomain, plot);
6282
+ return import_react9.default.createElement("line", {
6283
+ key: `quadrant-y-tick-${tick}`,
6284
+ x1: plot.x - 5,
6285
+ y1: y,
6286
+ x2: plot.x,
6287
+ y2: y,
6288
+ stroke: c.textMuted,
6289
+ strokeWidth: 1.2
6290
+ });
6291
+ }),
5995
6292
  ...pointGeometries.map(({ point, index, x, y, color }) => import_react9.default.createElement("circle", {
5996
6293
  key: `quadrant-point-${point.label ?? index}`,
5997
6294
  cx: x,
@@ -6002,23 +6299,31 @@ function QuadrantChart({
6002
6299
  strokeWidth: 3
6003
6300
  }))
6004
6301
  ),
6005
- ...regionEntries.flatMap(({ key, region, x, y }, index) => {
6302
+ ...regionEntries.flatMap(({ key, region, x, y, width: regionWidth }, index) => {
6006
6303
  const color = chartColor(region.color, c, index);
6007
6304
  return [
6008
- chartLabel(`quadrant-label-${key}`, region.label, x + halfWidth / 2, y + 18, c, {
6009
- width: halfWidth - 24,
6305
+ chartLabel(`quadrant-label-${key}`, region.label, x + regionWidth / 2, y + 18, c, {
6306
+ width: Math.max(1, regionWidth - 24),
6010
6307
  color,
6011
6308
  fontFamily: "Inter",
6012
6309
  fontWeight: 900,
6013
6310
  fontSize: 11
6014
6311
  }),
6015
- ...region.detail ? [chartLabel(`quadrant-detail-${key}`, region.detail, x + halfWidth / 2, y + 34, c, {
6016
- width: halfWidth - 24,
6312
+ ...region.detail ? [chartLabel(`quadrant-detail-${key}`, region.detail, x + regionWidth / 2, y + 34, c, {
6313
+ width: Math.max(1, regionWidth - 24),
6017
6314
  color: c.textMuted,
6018
6315
  fontSize: 11
6019
6316
  })] : []
6020
6317
  ];
6021
6318
  }),
6319
+ ...(showTicks ? xTicks : []).map((tick) => {
6320
+ const x = xInPlot(tick, xDomain, plot);
6321
+ return chartLabel(`quadrant-x-tick-label-${tick}`, formatChartValue(tick, formatX), x, plot.bottom + 18, c, { width: 54 });
6322
+ }),
6323
+ ...(showTicks ? yTicks : []).map((tick) => {
6324
+ const y = yInPlot(tick, yDomain, plot);
6325
+ return chartLabel(`quadrant-y-tick-label-${tick}`, formatChartValue(tick, formatY), plot.x - 9, y, c, { align: "right", width: 48 });
6326
+ }),
6022
6327
  ...pointGeometries.flatMap(({ point, index, x, y, color }) => {
6023
6328
  if (!point.label) return [];
6024
6329
  const placement = pointLabelPlacement(x, y, plot, index, 110);
@@ -7621,6 +7926,7 @@ async function renderAnimationGifWithOutput(animation, options) {
7621
7926
  MetricCard,
7622
7927
  MiniBarChart,
7623
7928
  Panel,
7929
+ ParetoChart,
7624
7930
  Pipeline,
7625
7931
  ProgressList,
7626
7932
  ProgressRow,
package/dist/index.d.cts CHANGED
@@ -1241,10 +1241,42 @@ interface ScatterPlotProps {
1241
1241
  footer?: string;
1242
1242
  }
1243
1243
  declare function ScatterPlot({ points, c, title, subtitle, width, height, xMin, xMax, yMin, yMax, xAxisLabel, yAxisLabel, formatX, formatY, showGrid, footer, }: ScatterPlotProps): React.ReactElement;
1244
+ type ParetoObjective = 'minimize' | 'maximize';
1245
+ type ParetoXScale = 'linear' | 'log';
1246
+ interface ParetoChartProps {
1247
+ points: ScatterPoint[];
1248
+ c: ThemeColors;
1249
+ title?: string;
1250
+ subtitle?: string;
1251
+ width?: number;
1252
+ height?: number;
1253
+ xMin?: number;
1254
+ xMax?: number;
1255
+ yMin?: number;
1256
+ yMax?: number;
1257
+ xAxisLabel?: string;
1258
+ yAxisLabel?: string;
1259
+ formatX?: ChartValueFormat;
1260
+ formatY?: ChartValueFormat;
1261
+ showGrid?: boolean;
1262
+ xScale?: ParetoXScale;
1263
+ xObjective?: ParetoObjective;
1264
+ yObjective?: ParetoObjective;
1265
+ frontierColor?: ColorName | string;
1266
+ showGoal?: boolean;
1267
+ goalLabel?: string;
1268
+ footer?: string;
1269
+ }
1270
+ /**
1271
+ * Scatter plot that highlights non-dominated points and their Pareto frontier.
1272
+ * By default, lower x and higher y are preferred, which suits cost-versus-score charts.
1273
+ */
1274
+ declare function ParetoChart({ points, c, title, subtitle, width, height, xMin, xMax, yMin, yMax, xAxisLabel, yAxisLabel, formatX, formatY, showGrid, xScale, xObjective, yObjective, frontierColor, showGoal, goalLabel, footer, }: ParetoChartProps): React.ReactElement;
1244
1275
  interface QuadrantRegion {
1245
1276
  label: string;
1246
1277
  detail?: string;
1247
1278
  color?: ColorName | string;
1279
+ emphasis?: boolean;
1248
1280
  }
1249
1281
  interface QuadrantChartProps {
1250
1282
  points: ScatterPoint[];
@@ -1259,11 +1291,21 @@ interface QuadrantChartProps {
1259
1291
  subtitle?: string;
1260
1292
  width?: number;
1261
1293
  height?: number;
1294
+ xMin?: number;
1295
+ xMax?: number;
1296
+ yMin?: number;
1297
+ yMax?: number;
1298
+ xThreshold?: number;
1299
+ yThreshold?: number;
1262
1300
  xAxisLabel?: string;
1263
1301
  yAxisLabel?: string;
1302
+ formatX?: ChartValueFormat;
1303
+ formatY?: ChartValueFormat;
1304
+ showTicks?: boolean;
1305
+ showGrid?: boolean;
1264
1306
  footer?: string;
1265
1307
  }
1266
- declare function QuadrantChart({ points, regions, c, title, subtitle, width, height, xAxisLabel, yAxisLabel, footer, }: QuadrantChartProps): React.ReactElement;
1308
+ declare function QuadrantChart({ points, regions, c, title, subtitle, width, height, xMin, xMax, yMin, yMax, xThreshold, yThreshold, xAxisLabel, yAxisLabel, formatX, formatY, showTicks, showGrid, footer, }: QuadrantChartProps): React.ReactElement;
1267
1309
  interface IntervalDatum {
1268
1310
  label: string;
1269
1311
  low: number;
@@ -1635,4 +1677,4 @@ declare function renderAnimatedGifWithOutput(scenes: AnimatedScene[], options: A
1635
1677
  declare function renderAnimationGif<S extends object>(animation: DefinedAnimation<S>, options: AnimationOptions): Promise<void>;
1636
1678
  declare function renderAnimationGifWithOutput<S extends object>(animation: DefinedAnimation<S>, options: AnimationOptions): Promise<AnimationOutput>;
1637
1679
 
1638
- export { type AnimatedScene, type AnimationDefinition, type AnimationEasing, type AnimationEasingName, type AnimationFrameContext, type AnimationHoldStep, type AnimationInterpolator, type AnimationKeyframeStep, type AnimationOptions, type AnimationOutput, type AnimationParallelStep, type AnimationParallelTracks, type AnimationPropertyStep, type AnimationTimelineStep, type AnimationTweenStep, Arrow, ArrowMarkerDef, AxisPlot, type AxisPlotPath, Badge, BadgePill, BarChart, type BarChartDatum, Box, CalloutCard, Canvas, CanvasOverflowError, Card, ChartFrame, type ChartLegendItem, type ChartMargins, type ChartValueFormat, CodeBlock, type CodeLineSpec, type ColorName, Column, Comparison, type ComparisonSideSpec, Connector, type CropMode, type CropRegion, DashedLine, DataTable, type DefinedAnimation, DetailList, type DiagramIconDefinition, type DiagramIconRenderProps, DonutChart, type DonutChartSegment, DotPoint, EquationCard, Flow, FlowArrow, type FlowStageSpec, GradientChip, GraphDiagram, type GraphDiagramEdge, type GraphDiagramEdgeArrow, type GraphDiagramEdgeKind, type GraphDiagramEdgeStyle, type GraphDiagramGroup, type GraphDiagramNode, type GraphDiagramProps, Grid, Heatmap, Icon, type IconName, type IconProps, type IllustrationBuilder, type IntervalDatum, IntervalPlot, KeyValueList, type KeyValueRow, LayeredNetwork, type LayeredNetworkLayer, Legend, LineChart, type LineChartSeries, MathText, Matrix, MetricCard, MiniBarChart, type MiniBarDatum, type OverflowResult, Panel, Pipeline, type PlotArea, ProgressList, ProgressRow, type ProgressRowSpec, QuadrantChart, type QuadrantRegion, type RenderBackground, type RenderOptions, type RenderOutput, Row, type SampleAnimationOptions, type SampledAnimationFrame, ScatterPlot, type ScatterPoint, Scene, Stack, StackedBar, type StackedBarSegment, type StatusKind, StatusList, StatusRow, type StatusRowSpec, StepCard, SvgFrame, SvgMathText, SvgPoint, TextLabel, type ThemeColors, type ThemeMode, type ThemePreset, Tile, TileGrid, type TileSpec, TiledMatrix, type TiledMatrixRegion, Timeline, type TimelineEventSpec, TitleBar, type ToneName, ToneStrip, type TransitionType, TreeDiagram, type TreeNodeSpec, ValuePill, VectorArrow, VectorSegment, Watermark, type WatermarkElementProps, type WatermarkImageOptions, type WatermarkInput, type WatermarkOptions, type WatermarkPosition, WindowFrame, canvas, colors, createPlotArea, cropPixels, defineAnimation, defineDiagramIcon, defineIconRegistry, defineIllustration, detectBackgroundColor, detectContentBounds, detectOverflow, formatMathText, getColor, getFonts, getGradient, getReadableColor, getReadableTextColor, getReadableToneColor, getStyles, getThemeColors, getToneColor, getToneFill, getToneGradient, gradients, heatColor, hold, keyframe, loadAdditionalAsset, normalizeWatermark, parallel, renderAnimatedGif, renderAnimatedGifWithOutput, renderAnimationGif, renderAnimationGifWithOutput, renderToBuffer, renderToPng, renderToPngWithOutput, renderToSvg, sampleAnimation, sampleAnimationFrames, styles, toneGradients, tween, typography, wrapWithBrand, wrapWithWatermark };
1680
+ export { type AnimatedScene, type AnimationDefinition, type AnimationEasing, type AnimationEasingName, type AnimationFrameContext, type AnimationHoldStep, type AnimationInterpolator, type AnimationKeyframeStep, type AnimationOptions, type AnimationOutput, type AnimationParallelStep, type AnimationParallelTracks, type AnimationPropertyStep, type AnimationTimelineStep, type AnimationTweenStep, Arrow, ArrowMarkerDef, AxisPlot, type AxisPlotPath, Badge, BadgePill, BarChart, type BarChartDatum, Box, CalloutCard, Canvas, CanvasOverflowError, Card, ChartFrame, type ChartLegendItem, type ChartMargins, type ChartValueFormat, CodeBlock, type CodeLineSpec, type ColorName, Column, Comparison, type ComparisonSideSpec, Connector, type CropMode, type CropRegion, DashedLine, DataTable, type DefinedAnimation, DetailList, type DiagramIconDefinition, type DiagramIconRenderProps, DonutChart, type DonutChartSegment, DotPoint, EquationCard, Flow, FlowArrow, type FlowStageSpec, GradientChip, GraphDiagram, type GraphDiagramEdge, type GraphDiagramEdgeArrow, type GraphDiagramEdgeKind, type GraphDiagramEdgeStyle, type GraphDiagramGroup, type GraphDiagramNode, type GraphDiagramProps, Grid, Heatmap, Icon, type IconName, type IconProps, type IllustrationBuilder, type IntervalDatum, IntervalPlot, KeyValueList, type KeyValueRow, LayeredNetwork, type LayeredNetworkLayer, Legend, LineChart, type LineChartSeries, MathText, Matrix, MetricCard, MiniBarChart, type MiniBarDatum, type OverflowResult, Panel, ParetoChart, type ParetoChartProps, type ParetoObjective, type ParetoXScale, Pipeline, type PlotArea, ProgressList, ProgressRow, type ProgressRowSpec, QuadrantChart, type QuadrantChartProps, type QuadrantRegion, type RenderBackground, type RenderOptions, type RenderOutput, Row, type SampleAnimationOptions, type SampledAnimationFrame, ScatterPlot, type ScatterPoint, Scene, Stack, StackedBar, type StackedBarSegment, type StatusKind, StatusList, StatusRow, type StatusRowSpec, StepCard, SvgFrame, SvgMathText, SvgPoint, TextLabel, type ThemeColors, type ThemeMode, type ThemePreset, Tile, TileGrid, type TileSpec, TiledMatrix, type TiledMatrixRegion, Timeline, type TimelineEventSpec, TitleBar, type ToneName, ToneStrip, type TransitionType, TreeDiagram, type TreeNodeSpec, ValuePill, VectorArrow, VectorSegment, Watermark, type WatermarkElementProps, type WatermarkImageOptions, type WatermarkInput, type WatermarkOptions, type WatermarkPosition, WindowFrame, canvas, colors, createPlotArea, cropPixels, defineAnimation, defineDiagramIcon, defineIconRegistry, defineIllustration, detectBackgroundColor, detectContentBounds, detectOverflow, formatMathText, getColor, getFonts, getGradient, getReadableColor, getReadableTextColor, getReadableToneColor, getStyles, getThemeColors, getToneColor, getToneFill, getToneGradient, gradients, heatColor, hold, keyframe, loadAdditionalAsset, normalizeWatermark, parallel, renderAnimatedGif, renderAnimatedGifWithOutput, renderAnimationGif, renderAnimationGifWithOutput, renderToBuffer, renderToPng, renderToPngWithOutput, renderToSvg, sampleAnimation, sampleAnimationFrames, styles, toneGradients, tween, typography, wrapWithBrand, wrapWithWatermark };
package/dist/index.d.ts CHANGED
@@ -1241,10 +1241,42 @@ interface ScatterPlotProps {
1241
1241
  footer?: string;
1242
1242
  }
1243
1243
  declare function ScatterPlot({ points, c, title, subtitle, width, height, xMin, xMax, yMin, yMax, xAxisLabel, yAxisLabel, formatX, formatY, showGrid, footer, }: ScatterPlotProps): React.ReactElement;
1244
+ type ParetoObjective = 'minimize' | 'maximize';
1245
+ type ParetoXScale = 'linear' | 'log';
1246
+ interface ParetoChartProps {
1247
+ points: ScatterPoint[];
1248
+ c: ThemeColors;
1249
+ title?: string;
1250
+ subtitle?: string;
1251
+ width?: number;
1252
+ height?: number;
1253
+ xMin?: number;
1254
+ xMax?: number;
1255
+ yMin?: number;
1256
+ yMax?: number;
1257
+ xAxisLabel?: string;
1258
+ yAxisLabel?: string;
1259
+ formatX?: ChartValueFormat;
1260
+ formatY?: ChartValueFormat;
1261
+ showGrid?: boolean;
1262
+ xScale?: ParetoXScale;
1263
+ xObjective?: ParetoObjective;
1264
+ yObjective?: ParetoObjective;
1265
+ frontierColor?: ColorName | string;
1266
+ showGoal?: boolean;
1267
+ goalLabel?: string;
1268
+ footer?: string;
1269
+ }
1270
+ /**
1271
+ * Scatter plot that highlights non-dominated points and their Pareto frontier.
1272
+ * By default, lower x and higher y are preferred, which suits cost-versus-score charts.
1273
+ */
1274
+ declare function ParetoChart({ points, c, title, subtitle, width, height, xMin, xMax, yMin, yMax, xAxisLabel, yAxisLabel, formatX, formatY, showGrid, xScale, xObjective, yObjective, frontierColor, showGoal, goalLabel, footer, }: ParetoChartProps): React.ReactElement;
1244
1275
  interface QuadrantRegion {
1245
1276
  label: string;
1246
1277
  detail?: string;
1247
1278
  color?: ColorName | string;
1279
+ emphasis?: boolean;
1248
1280
  }
1249
1281
  interface QuadrantChartProps {
1250
1282
  points: ScatterPoint[];
@@ -1259,11 +1291,21 @@ interface QuadrantChartProps {
1259
1291
  subtitle?: string;
1260
1292
  width?: number;
1261
1293
  height?: number;
1294
+ xMin?: number;
1295
+ xMax?: number;
1296
+ yMin?: number;
1297
+ yMax?: number;
1298
+ xThreshold?: number;
1299
+ yThreshold?: number;
1262
1300
  xAxisLabel?: string;
1263
1301
  yAxisLabel?: string;
1302
+ formatX?: ChartValueFormat;
1303
+ formatY?: ChartValueFormat;
1304
+ showTicks?: boolean;
1305
+ showGrid?: boolean;
1264
1306
  footer?: string;
1265
1307
  }
1266
- declare function QuadrantChart({ points, regions, c, title, subtitle, width, height, xAxisLabel, yAxisLabel, footer, }: QuadrantChartProps): React.ReactElement;
1308
+ declare function QuadrantChart({ points, regions, c, title, subtitle, width, height, xMin, xMax, yMin, yMax, xThreshold, yThreshold, xAxisLabel, yAxisLabel, formatX, formatY, showTicks, showGrid, footer, }: QuadrantChartProps): React.ReactElement;
1267
1309
  interface IntervalDatum {
1268
1310
  label: string;
1269
1311
  low: number;
@@ -1635,4 +1677,4 @@ declare function renderAnimatedGifWithOutput(scenes: AnimatedScene[], options: A
1635
1677
  declare function renderAnimationGif<S extends object>(animation: DefinedAnimation<S>, options: AnimationOptions): Promise<void>;
1636
1678
  declare function renderAnimationGifWithOutput<S extends object>(animation: DefinedAnimation<S>, options: AnimationOptions): Promise<AnimationOutput>;
1637
1679
 
1638
- export { type AnimatedScene, type AnimationDefinition, type AnimationEasing, type AnimationEasingName, type AnimationFrameContext, type AnimationHoldStep, type AnimationInterpolator, type AnimationKeyframeStep, type AnimationOptions, type AnimationOutput, type AnimationParallelStep, type AnimationParallelTracks, type AnimationPropertyStep, type AnimationTimelineStep, type AnimationTweenStep, Arrow, ArrowMarkerDef, AxisPlot, type AxisPlotPath, Badge, BadgePill, BarChart, type BarChartDatum, Box, CalloutCard, Canvas, CanvasOverflowError, Card, ChartFrame, type ChartLegendItem, type ChartMargins, type ChartValueFormat, CodeBlock, type CodeLineSpec, type ColorName, Column, Comparison, type ComparisonSideSpec, Connector, type CropMode, type CropRegion, DashedLine, DataTable, type DefinedAnimation, DetailList, type DiagramIconDefinition, type DiagramIconRenderProps, DonutChart, type DonutChartSegment, DotPoint, EquationCard, Flow, FlowArrow, type FlowStageSpec, GradientChip, GraphDiagram, type GraphDiagramEdge, type GraphDiagramEdgeArrow, type GraphDiagramEdgeKind, type GraphDiagramEdgeStyle, type GraphDiagramGroup, type GraphDiagramNode, type GraphDiagramProps, Grid, Heatmap, Icon, type IconName, type IconProps, type IllustrationBuilder, type IntervalDatum, IntervalPlot, KeyValueList, type KeyValueRow, LayeredNetwork, type LayeredNetworkLayer, Legend, LineChart, type LineChartSeries, MathText, Matrix, MetricCard, MiniBarChart, type MiniBarDatum, type OverflowResult, Panel, Pipeline, type PlotArea, ProgressList, ProgressRow, type ProgressRowSpec, QuadrantChart, type QuadrantRegion, type RenderBackground, type RenderOptions, type RenderOutput, Row, type SampleAnimationOptions, type SampledAnimationFrame, ScatterPlot, type ScatterPoint, Scene, Stack, StackedBar, type StackedBarSegment, type StatusKind, StatusList, StatusRow, type StatusRowSpec, StepCard, SvgFrame, SvgMathText, SvgPoint, TextLabel, type ThemeColors, type ThemeMode, type ThemePreset, Tile, TileGrid, type TileSpec, TiledMatrix, type TiledMatrixRegion, Timeline, type TimelineEventSpec, TitleBar, type ToneName, ToneStrip, type TransitionType, TreeDiagram, type TreeNodeSpec, ValuePill, VectorArrow, VectorSegment, Watermark, type WatermarkElementProps, type WatermarkImageOptions, type WatermarkInput, type WatermarkOptions, type WatermarkPosition, WindowFrame, canvas, colors, createPlotArea, cropPixels, defineAnimation, defineDiagramIcon, defineIconRegistry, defineIllustration, detectBackgroundColor, detectContentBounds, detectOverflow, formatMathText, getColor, getFonts, getGradient, getReadableColor, getReadableTextColor, getReadableToneColor, getStyles, getThemeColors, getToneColor, getToneFill, getToneGradient, gradients, heatColor, hold, keyframe, loadAdditionalAsset, normalizeWatermark, parallel, renderAnimatedGif, renderAnimatedGifWithOutput, renderAnimationGif, renderAnimationGifWithOutput, renderToBuffer, renderToPng, renderToPngWithOutput, renderToSvg, sampleAnimation, sampleAnimationFrames, styles, toneGradients, tween, typography, wrapWithBrand, wrapWithWatermark };
1680
+ export { type AnimatedScene, type AnimationDefinition, type AnimationEasing, type AnimationEasingName, type AnimationFrameContext, type AnimationHoldStep, type AnimationInterpolator, type AnimationKeyframeStep, type AnimationOptions, type AnimationOutput, type AnimationParallelStep, type AnimationParallelTracks, type AnimationPropertyStep, type AnimationTimelineStep, type AnimationTweenStep, Arrow, ArrowMarkerDef, AxisPlot, type AxisPlotPath, Badge, BadgePill, BarChart, type BarChartDatum, Box, CalloutCard, Canvas, CanvasOverflowError, Card, ChartFrame, type ChartLegendItem, type ChartMargins, type ChartValueFormat, CodeBlock, type CodeLineSpec, type ColorName, Column, Comparison, type ComparisonSideSpec, Connector, type CropMode, type CropRegion, DashedLine, DataTable, type DefinedAnimation, DetailList, type DiagramIconDefinition, type DiagramIconRenderProps, DonutChart, type DonutChartSegment, DotPoint, EquationCard, Flow, FlowArrow, type FlowStageSpec, GradientChip, GraphDiagram, type GraphDiagramEdge, type GraphDiagramEdgeArrow, type GraphDiagramEdgeKind, type GraphDiagramEdgeStyle, type GraphDiagramGroup, type GraphDiagramNode, type GraphDiagramProps, Grid, Heatmap, Icon, type IconName, type IconProps, type IllustrationBuilder, type IntervalDatum, IntervalPlot, KeyValueList, type KeyValueRow, LayeredNetwork, type LayeredNetworkLayer, Legend, LineChart, type LineChartSeries, MathText, Matrix, MetricCard, MiniBarChart, type MiniBarDatum, type OverflowResult, Panel, ParetoChart, type ParetoChartProps, type ParetoObjective, type ParetoXScale, Pipeline, type PlotArea, ProgressList, ProgressRow, type ProgressRowSpec, QuadrantChart, type QuadrantChartProps, type QuadrantRegion, type RenderBackground, type RenderOptions, type RenderOutput, Row, type SampleAnimationOptions, type SampledAnimationFrame, ScatterPlot, type ScatterPoint, Scene, Stack, StackedBar, type StackedBarSegment, type StatusKind, StatusList, StatusRow, type StatusRowSpec, StepCard, SvgFrame, SvgMathText, SvgPoint, TextLabel, type ThemeColors, type ThemeMode, type ThemePreset, Tile, TileGrid, type TileSpec, TiledMatrix, type TiledMatrixRegion, Timeline, type TimelineEventSpec, TitleBar, type ToneName, ToneStrip, type TransitionType, TreeDiagram, type TreeNodeSpec, ValuePill, VectorArrow, VectorSegment, Watermark, type WatermarkElementProps, type WatermarkImageOptions, type WatermarkInput, type WatermarkOptions, type WatermarkPosition, WindowFrame, canvas, colors, createPlotArea, cropPixels, defineAnimation, defineDiagramIcon, defineIconRegistry, defineIllustration, detectBackgroundColor, detectContentBounds, detectOverflow, formatMathText, getColor, getFonts, getGradient, getReadableColor, getReadableTextColor, getReadableToneColor, getStyles, getThemeColors, getToneColor, getToneFill, getToneGradient, gradients, heatColor, hold, keyframe, loadAdditionalAsset, normalizeWatermark, parallel, renderAnimatedGif, renderAnimatedGifWithOutput, renderAnimationGif, renderAnimationGifWithOutput, renderToBuffer, renderToPng, renderToPngWithOutput, renderToSvg, sampleAnimation, sampleAnimationFrames, styles, toneGradients, tween, typography, wrapWithBrand, wrapWithWatermark };