@ixfx/components 0.1.5 → 0.2.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.
- package/bundle/index.d.ts +105 -37
- package/bundle/index.d.ts.map +1 -1
- package/bundle/index.js +471 -156
- package/bundle/index.js.map +1 -1
- package/dist/charts/plot.d.ts +104 -36
- package/dist/charts/plot.d.ts.map +1 -1
- package/dist/charts/plot.js +621 -175
- package/dist/charts/plot.js.map +1 -1
- package/package.json +13 -13
package/bundle/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RectPositioned } from "ixfx/geometry.js";
|
|
2
|
+
import * as Numbers from "ixfx/numbers.js";
|
|
2
3
|
import { Trees } from "ixfx/collections.js";
|
|
3
|
-
import { CanvasHelper,
|
|
4
|
+
import { CanvasHelper, DrawingHelper } from "ixfx/visual.js";
|
|
4
5
|
|
|
5
6
|
//#region node_modules/@lit/reactive-element/development/css-tag.d.ts
|
|
6
7
|
|
|
@@ -1352,6 +1353,27 @@ declare global {
|
|
|
1352
1353
|
//# sourceMappingURL=split-layout.d.ts.map
|
|
1353
1354
|
//#endregion
|
|
1354
1355
|
//#region src/charts/plot.d.ts
|
|
1356
|
+
type SeriesColourGenerator = (seriesName: string) => string;
|
|
1357
|
+
declare class PlotAxis {
|
|
1358
|
+
#private;
|
|
1359
|
+
name: string;
|
|
1360
|
+
bounds: PlotAxisBounds;
|
|
1361
|
+
constructor(name: string);
|
|
1362
|
+
humanFormatValue(value: number[]): string;
|
|
1363
|
+
getRange(series: Iterable<PlotSeries>): Numbers.NumericRange;
|
|
1364
|
+
getCurrentRange(): Readonly<{
|
|
1365
|
+
min: number;
|
|
1366
|
+
max: number;
|
|
1367
|
+
}> | undefined;
|
|
1368
|
+
getValueScaler(series: Iterable<PlotSeries>): (value: number) => number;
|
|
1369
|
+
computeActualRange(seriesOnAxis: Iterable<PlotSeries>, column?: number): {
|
|
1370
|
+
min: number;
|
|
1371
|
+
max: number;
|
|
1372
|
+
};
|
|
1373
|
+
}
|
|
1374
|
+
type PlotSeriesDefault = {
|
|
1375
|
+
limit: number;
|
|
1376
|
+
};
|
|
1355
1377
|
/**
|
|
1356
1378
|
* Attributes
|
|
1357
1379
|
* * streaming: true/false (default: true)
|
|
@@ -1361,7 +1383,7 @@ declare global {
|
|
|
1361
1383
|
*
|
|
1362
1384
|
* * line-width: stroke width of drawing line (default:2)
|
|
1363
1385
|
*
|
|
1364
|
-
* * render: 'dot' or '
|
|
1386
|
+
* * render: 'dot', 'line' or 'bar'(default: 'dot')
|
|
1365
1387
|
* * hide-legend: If added, legend is not shown
|
|
1366
1388
|
* * manual-draw: If added, automatic drawning is disabled
|
|
1367
1389
|
*
|
|
@@ -1370,21 +1392,29 @@ declare global {
|
|
|
1370
1392
|
*/
|
|
1371
1393
|
declare class PlotElement extends LitElement {
|
|
1372
1394
|
#private;
|
|
1373
|
-
streaming: boolean;
|
|
1374
1395
|
hideLegend: boolean;
|
|
1375
|
-
|
|
1376
|
-
dataWidth: number;
|
|
1377
|
-
fixedMax: number;
|
|
1378
|
-
fixedMin: number;
|
|
1379
|
-
lineWidth: number;
|
|
1380
|
-
renderStyle: string;
|
|
1381
|
-
manualDraw: boolean;
|
|
1396
|
+
renderStyle: PlotElementRenderStyle;
|
|
1382
1397
|
padding: number;
|
|
1398
|
+
readonly primaryAxis: PlotAxis;
|
|
1399
|
+
readonly secondaryAxis: PlotAxis;
|
|
1383
1400
|
paused: boolean;
|
|
1401
|
+
plotAreaFormat: PlotObjectFormatting;
|
|
1402
|
+
/**
|
|
1403
|
+
* Settings used for automatically generating series colour
|
|
1404
|
+
*/
|
|
1405
|
+
automaticSeriesColour: {
|
|
1406
|
+
saturation: number;
|
|
1407
|
+
lightness: number;
|
|
1408
|
+
alpha: number;
|
|
1409
|
+
};
|
|
1410
|
+
seriesDefault: Partial<PlotSeriesDefault>;
|
|
1384
1411
|
canvasEl: Ref<HTMLCanvasElement>;
|
|
1385
|
-
|
|
1412
|
+
tooltipEl: Ref<HTMLDivElement>;
|
|
1413
|
+
seriesColourGenerate: SeriesColourGenerator;
|
|
1386
1414
|
get series(): PlotSeries[];
|
|
1387
1415
|
get seriesCount(): number;
|
|
1416
|
+
getSeriesFormatting(seriesName: string, createIfNeeded: boolean): SeriesFormatting | undefined;
|
|
1417
|
+
setSeriesFormatting(seriesName: string, formatting: Partial<SeriesFormatting>): void;
|
|
1388
1418
|
/**
|
|
1389
1419
|
* Returns a `PlotElement` instance based on a query
|
|
1390
1420
|
* ```js
|
|
@@ -1417,23 +1447,24 @@ declare class PlotElement extends LitElement {
|
|
|
1417
1447
|
* Keeps all series, but deletes their data
|
|
1418
1448
|
*/
|
|
1419
1449
|
clearData(): void;
|
|
1420
|
-
render(): TemplateResult<1>;
|
|
1421
1450
|
connectedCallback(): void;
|
|
1422
1451
|
protected firstUpdated(_changedProperties: PropertyValues): void;
|
|
1423
1452
|
updateColours(): void;
|
|
1424
|
-
|
|
1425
|
-
|
|
1453
|
+
setRawValues(values: number[], seriesName: string, automaticallyDraw: boolean): PlotSeries;
|
|
1454
|
+
/**
|
|
1455
|
+
* Treats each property of an object as the series name
|
|
1456
|
+
* @param value
|
|
1457
|
+
* @param automaticallyDraw
|
|
1458
|
+
*/
|
|
1459
|
+
appendObjectBySeries(value: object, automaticallyDraw: boolean): void;
|
|
1460
|
+
appendRawValues(values: number[] | number, seriesName: string, automaticallyDraw: boolean): void;
|
|
1426
1461
|
/**
|
|
1427
1462
|
* Draw a set of key-value pairs as a batch.
|
|
1428
1463
|
* @param value
|
|
1429
1464
|
*/
|
|
1430
|
-
plotObject(value: object): void;
|
|
1431
|
-
colourGenerator(_series: string): Colour.Colourish;
|
|
1432
1465
|
draw(): void;
|
|
1433
1466
|
drawLegend(cl: RectPositioned, d: DrawingHelper): void;
|
|
1434
|
-
|
|
1435
|
-
drawDotSeries(data: number[], cp: Rect, d: DrawingHelper, colour: string): void;
|
|
1436
|
-
computePlot(c: CanvasHelper, plotHeight: number, axisYwidth: number, padding: number): {
|
|
1467
|
+
calculatePlotDataArea(c: CanvasHelper, plotHeight: number, axisYwidth: number, padding: number): {
|
|
1437
1468
|
x: number;
|
|
1438
1469
|
y: number;
|
|
1439
1470
|
width: number;
|
|
@@ -1452,29 +1483,66 @@ declare class PlotElement extends LitElement {
|
|
|
1452
1483
|
y: number;
|
|
1453
1484
|
}[];
|
|
1454
1485
|
};
|
|
1486
|
+
getOrCreateSeries(name: string): PlotSeries;
|
|
1455
1487
|
getSeries(name: string): PlotSeries | undefined;
|
|
1488
|
+
render(): TemplateResult<1>;
|
|
1456
1489
|
static styles: CSSResult;
|
|
1457
1490
|
}
|
|
1491
|
+
type SolidColourDrawStyle = Readonly<{
|
|
1492
|
+
type: `solid`;
|
|
1493
|
+
colour: string;
|
|
1494
|
+
}>;
|
|
1495
|
+
type NoneDrawStyle = Readonly<{
|
|
1496
|
+
type: `none`;
|
|
1497
|
+
}>;
|
|
1498
|
+
type FillDrawStyle = SolidColourDrawStyle | NoneDrawStyle;
|
|
1499
|
+
type OutlineDrawStyle = SolidColourDrawStyle | NoneDrawStyle;
|
|
1500
|
+
type SeriesFormatting = PlotObjectFormatting & Readonly<{
|
|
1501
|
+
axis: `primary` | `secondary`;
|
|
1502
|
+
bar: BarSeriesFormatting;
|
|
1503
|
+
dot: DotSeriesFormatting;
|
|
1504
|
+
line: LineSeriesFormatting;
|
|
1505
|
+
}>;
|
|
1506
|
+
type PlotObjectFormatting = Readonly<{
|
|
1507
|
+
fill: FillDrawStyle;
|
|
1508
|
+
outline: OutlineDrawStyle;
|
|
1509
|
+
}>;
|
|
1510
|
+
type BarSeriesFormatting = {
|
|
1511
|
+
gapWidth: number;
|
|
1512
|
+
};
|
|
1513
|
+
type DotSeriesFormatting = {
|
|
1514
|
+
gapWidth: number;
|
|
1515
|
+
radius: `automatic` | number;
|
|
1516
|
+
};
|
|
1517
|
+
type LineSeriesFormatting = {
|
|
1518
|
+
width: number;
|
|
1519
|
+
cap: `round` | `butt` | `square`;
|
|
1520
|
+
join: `bevel` | `miter` | `round`;
|
|
1521
|
+
};
|
|
1458
1522
|
declare class PlotSeries {
|
|
1459
|
-
|
|
1460
|
-
|
|
1523
|
+
#private;
|
|
1524
|
+
readonly name: string;
|
|
1461
1525
|
private plot;
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1526
|
+
constructor(name: string, plot: PlotElement);
|
|
1527
|
+
get length(): number;
|
|
1528
|
+
getValuesForColumn(column: number): Generator<[value: number, index: number]>;
|
|
1529
|
+
getValue(index: number): number[] | undefined;
|
|
1530
|
+
pushValue(value: number[] | number, automaticallyDraw: boolean): void;
|
|
1531
|
+
setValues(values: number[][], automaticallyDraw: boolean): void;
|
|
1532
|
+
humanFormatValue(value: number[]): string;
|
|
1533
|
+
setRawValues(values: number[], automaticallyDraw: boolean): void;
|
|
1534
|
+
setCapacityLimit(v: number): void;
|
|
1535
|
+
unsetCapacityLimit(): void;
|
|
1536
|
+
setFormatting(formatting: Partial<SeriesFormatting>): void;
|
|
1537
|
+
getFormatting(): SeriesFormatting;
|
|
1538
|
+
get isDirty(): boolean;
|
|
1539
|
+
set isDirty(value: boolean);
|
|
1540
|
+
get onPrimaryAxis(): boolean;
|
|
1541
|
+
set onPrimaryAxis(value: boolean);
|
|
1466
1542
|
clear(): void;
|
|
1467
|
-
/**
|
|
1468
|
-
* Returns a copy of the data scaled by the current
|
|
1469
|
-
* range of the data
|
|
1470
|
-
* @returns
|
|
1471
|
-
*/
|
|
1472
|
-
getScaled(): number[];
|
|
1473
|
-
getScaledBy(scaler: (v: number) => number): number[];
|
|
1474
|
-
push(value: number): void;
|
|
1475
|
-
setValues(values: number[]): void;
|
|
1476
|
-
resetScale(): void;
|
|
1477
1543
|
}
|
|
1544
|
+
type PlotAxisBounds = `automatic` | Numbers.NumericRange;
|
|
1545
|
+
type PlotElementRenderStyle = `dot` | `line` | `bar`;
|
|
1478
1546
|
declare global {
|
|
1479
1547
|
interface HTMLElementTagNameMap {
|
|
1480
1548
|
"ixfx-plot-element": PlotElement;
|
|
@@ -1581,5 +1649,5 @@ declare const init: () => void;
|
|
|
1581
1649
|
//# sourceMappingURL=index.d.ts.map
|
|
1582
1650
|
|
|
1583
1651
|
//#endregion
|
|
1584
|
-
export { CrumbNavElement, CrumbNavigation2Part, CrumbNavigationElement, CrumbNavigationPart, DialElement, FrequencyHistogramPlot, HistogramVis, LabelPosition, NeedleStyle, PlotElement, PlotSeries, RequestPopup, SelectHorizontalElement, SplitLayoutElement, TabListElement, TabListItemElement, TabPanelElement, TabPanelsElement, ValueToLabelFormat, init };
|
|
1652
|
+
export { BarSeriesFormatting, CrumbNavElement, CrumbNavigation2Part, CrumbNavigationElement, CrumbNavigationPart, DialElement, DotSeriesFormatting, FillDrawStyle, FrequencyHistogramPlot, HistogramVis, LabelPosition, LineSeriesFormatting, NeedleStyle, NoneDrawStyle, OutlineDrawStyle, PlotAxis, PlotAxisBounds, PlotElement, PlotElementRenderStyle, PlotObjectFormatting, PlotSeries, PlotSeriesDefault, RequestPopup, SelectHorizontalElement, SeriesColourGenerator, SeriesFormatting, SolidColourDrawStyle, SplitLayoutElement, TabListElement, TabListItemElement, TabPanelElement, TabPanelsElement, ValueToLabelFormat, init };
|
|
1585
1653
|
//# sourceMappingURL=index.d.ts.map
|