@opendata-ai/openchart-core 8.0.0-rc.3 → 8.0.0-rc.5
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.d.ts +29 -6
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/package.json +1 -1
- package/src/styles/animation.css +6 -5
- package/src/styles/keyframes.css +17 -1
- package/src/types/layout.ts +3 -1
- package/src/types/spec.ts +23 -6
package/dist/index.d.ts
CHANGED
|
@@ -2424,9 +2424,21 @@ interface TileMapSpec {
|
|
|
2424
2424
|
/** Supported map projections. */
|
|
2425
2425
|
type MapProjection = 'albersUsa' | 'mercator' | 'equalEarth' | 'identity';
|
|
2426
2426
|
/** Focus target for map camera: feature id(s) to zoom/pan to. */
|
|
2427
|
+
/**
|
|
2428
|
+
* Fit the point layer's cluster. `true` fits every point; `{ field, value }`
|
|
2429
|
+
* fits only the points whose data row has `row[field] === value` (e.g. only the
|
|
2430
|
+
* campuses rated "F"), which lets a story pan between sub-clusters.
|
|
2431
|
+
*/
|
|
2432
|
+
type MapPointsFocus = true | {
|
|
2433
|
+
field: string;
|
|
2434
|
+
value: string | number;
|
|
2435
|
+
};
|
|
2427
2436
|
type MapFocus = string | number | Array<string | number> | {
|
|
2428
2437
|
features: string | number | Array<string | number>;
|
|
2429
2438
|
padding?: number;
|
|
2439
|
+
} | {
|
|
2440
|
+
points: MapPointsFocus;
|
|
2441
|
+
padding?: number;
|
|
2430
2442
|
};
|
|
2431
2443
|
/** Geo configuration for map specs. */
|
|
2432
2444
|
interface MapGeo {
|
|
@@ -2436,13 +2448,20 @@ interface MapGeo {
|
|
|
2436
2448
|
idField?: string;
|
|
2437
2449
|
/** Map projection. Defaults to 'albersUsa'. */
|
|
2438
2450
|
projection?: MapProjection;
|
|
2439
|
-
/**
|
|
2451
|
+
/**
|
|
2452
|
+
* Focus the camera. A feature id (or array) fits those features; `{ features, padding }`
|
|
2453
|
+
* adds breathing room; `{ points: true, padding }` fits the points layer's cluster
|
|
2454
|
+
* instead of any feature (use when points occupy a small part of a large feature, so
|
|
2455
|
+
* fitting the feature would leave the cluster small and off-center);
|
|
2456
|
+
* `{ points: { field, value }, padding }` fits only the matching point subset, so a
|
|
2457
|
+
* story can pan between sub-clusters. null clears focus from a prior story step.
|
|
2458
|
+
*/
|
|
2440
2459
|
focus?: MapFocus | null;
|
|
2441
2460
|
}
|
|
2442
2461
|
/** Encoding channels specific to map visualizations. */
|
|
2443
2462
|
interface MapEncoding {
|
|
2444
|
-
/** Join key field in the data
|
|
2445
|
-
key
|
|
2463
|
+
/** Join key field in the data. Required for choropleth; optional in basemap-only mode (points layer with empty data). */
|
|
2464
|
+
key?: EncodingChannel;
|
|
2446
2465
|
/** Color encoding (quantitative or nominal). Drives fill color of features. Optional when a points layer is present (basemap-only mode). */
|
|
2447
2466
|
color?: EncodingChannel;
|
|
2448
2467
|
/** Tooltip encoding (optional). */
|
|
@@ -2456,14 +2475,16 @@ interface MapPointsLayer {
|
|
|
2456
2475
|
longitude: EncodingChannel;
|
|
2457
2476
|
/** Field holding latitude (y coordinate). */
|
|
2458
2477
|
latitude: EncodingChannel;
|
|
2459
|
-
/** Optional quantitative size encoding. Area-proportional: r proportional to sqrt(value). */
|
|
2478
|
+
/** Optional quantitative size encoding. Area-proportional: r proportional to sqrt(value). No size legend is rendered in v1; explain the scale in chrome.subtitle if needed. */
|
|
2460
2479
|
size?: EncodingChannel;
|
|
2461
2480
|
/** Optional color encoding (nominal or quantitative). Independent scale from choropleth. */
|
|
2462
2481
|
color?: EncodingChannel;
|
|
2463
2482
|
/** Tooltip channel(s), same shape as MapEncoding.tooltip. */
|
|
2464
2483
|
tooltip?: EncodingChannel | EncodingChannel[];
|
|
2465
|
-
/** Stable id
|
|
2484
|
+
/** Stable id for event callbacks. Data-update transitions for points are not yet supported. */
|
|
2466
2485
|
key?: EncodingChannel;
|
|
2486
|
+
/** Fill opacity for point circles. Default 0.65. Range 0-1. */
|
|
2487
|
+
opacity?: number;
|
|
2467
2488
|
}
|
|
2468
2489
|
interface MapSpec {
|
|
2469
2490
|
/** Discriminant: always "map". */
|
|
@@ -4678,7 +4699,9 @@ interface MapPointMark {
|
|
|
4678
4699
|
stroke: string;
|
|
4679
4700
|
/** Stroke width in px. */
|
|
4680
4701
|
strokeWidth: number;
|
|
4681
|
-
/**
|
|
4702
|
+
/** Fill opacity (0-1). */
|
|
4703
|
+
fillOpacity: number;
|
|
4704
|
+
/** Stable key for events. */
|
|
4682
4705
|
key: string;
|
|
4683
4706
|
/** Original data row. */
|
|
4684
4707
|
data: Record<string, unknown>;
|