@visuallyjs/browser-ui-angular 1.1.3 → 1.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.
Files changed (54) hide show
  1. package/esm2022/index.mjs +3 -0
  2. package/esm2022/lib/charts/area.chart.component.mjs +8 -36
  3. package/esm2022/lib/charts/bar.chart.component.mjs +8 -36
  4. package/esm2022/lib/charts/bubble.chart.component.mjs +8 -36
  5. package/esm2022/lib/charts/column.chart.component.mjs +8 -36
  6. package/esm2022/lib/charts/line.chart.component.mjs +8 -36
  7. package/esm2022/lib/charts/pie.chart.component.mjs +8 -36
  8. package/esm2022/lib/charts/sankey.chart.component.mjs +12 -8
  9. package/esm2022/lib/charts/scatter.chart.component.mjs +8 -36
  10. package/esm2022/lib/charts/series.based.chart.component.mjs +54 -0
  11. package/esm2022/lib/charts/xy.chart.component.mjs +10 -22
  12. package/esm2022/lib/color.tag.component.mjs +33 -27
  13. package/esm2022/lib/controls-component.mjs +48 -44
  14. package/esm2022/lib/diagram-palette-component.mjs +37 -32
  15. package/esm2022/lib/edge.type.picker.component.mjs +23 -18
  16. package/esm2022/lib/export-controls-component.mjs +7 -9
  17. package/esm2022/lib/hooks/use-visuallyjs-update.mjs +21 -0
  18. package/esm2022/lib/hooks/use-zoom.mjs +24 -0
  19. package/esm2022/lib/inspector.component.mjs +29 -27
  20. package/esm2022/lib/miniview-component.mjs +33 -25
  21. package/esm2022/lib/palette.component.mjs +42 -37
  22. package/esm2022/lib/shape.component.mjs +20 -18
  23. package/esm2022/lib/shape.palette.component.mjs +25 -21
  24. package/esm2022/lib/surface-component.mjs +7 -5
  25. package/esm2022/lib/vjs-service.mjs +35 -1
  26. package/fesm2022/visuallyjs-browser-ui-angular.mjs +466 -503
  27. package/fesm2022/visuallyjs-browser-ui-angular.mjs.map +1 -1
  28. package/index.d.ts +3 -0
  29. package/lib/charts/area.chart.component.d.ts +10 -15
  30. package/lib/charts/bar.chart.component.d.ts +9 -15
  31. package/lib/charts/bubble.chart.component.d.ts +12 -15
  32. package/lib/charts/column.chart.component.d.ts +12 -15
  33. package/lib/charts/line.chart.component.d.ts +16 -17
  34. package/lib/charts/pie.chart.component.d.ts +9 -15
  35. package/lib/charts/sankey.chart.component.d.ts +5 -0
  36. package/lib/charts/scatter.chart.component.d.ts +9 -15
  37. package/lib/charts/series.based.chart.component.d.ts +44 -0
  38. package/lib/charts/xy.chart.component.d.ts +13 -11
  39. package/lib/color.tag.component.d.ts +5 -5
  40. package/lib/controls-component.d.ts +6 -4
  41. package/lib/diagram-palette-component.d.ts +8 -2
  42. package/lib/edge.type.picker.component.d.ts +5 -5
  43. package/lib/export-controls-component.d.ts +6 -6
  44. package/lib/hooks/use-visuallyjs-update.d.ts +21 -0
  45. package/lib/hooks/use-zoom.d.ts +6 -0
  46. package/lib/inspector.component.d.ts +6 -7
  47. package/lib/miniview-component.d.ts +17 -9
  48. package/lib/palette.component.d.ts +5 -6
  49. package/lib/shape.component.d.ts +5 -5
  50. package/lib/shape.palette.component.d.ts +5 -3
  51. package/lib/surface-component.d.ts +5 -1
  52. package/lib/vjs-service.d.ts +41 -0
  53. package/package.json +2 -2
  54. package/visuallyjs-browser-ui-angular.tgz +0 -0
package/index.d.ts CHANGED
@@ -29,6 +29,7 @@ export * from './lib/edge.type.picker.component';
29
29
  export * from './lib/inspector.component';
30
30
  export * from './lib/color.tag.component';
31
31
  export * from './lib/diagram-component';
32
+ export * from './lib/charts/series.based.chart.component';
32
33
  export * from './lib/charts/column.chart.component';
33
34
  export * from './lib/charts/bar.chart.component';
34
35
  export * from './lib/charts/line.chart.component';
@@ -38,3 +39,5 @@ export * from './lib/charts/pie.chart.component';
38
39
  export * from './lib/charts/scatter.chart.component';
39
40
  export * from './lib/charts/bubble.chart.component';
40
41
  export * from './lib/charts/sankey.chart.component';
42
+ export * from './lib/hooks/use-zoom';
43
+ export * from './lib/hooks/use-visuallyjs-update';
@@ -1,13 +1,17 @@
1
- import { AfterViewInit, ElementRef, NgZone, OnDestroy } from "@angular/core";
2
- import { AreaChartOptions, ObjectData } from "@visuallyjs/browser-ui";
3
- import { VisuallyJsService } from "../vjs-service";
1
+ import { AreaChart, AreaChartOptions, BrowserElement, ObjectData } from "@visuallyjs/browser-ui";
2
+ import { SeriesBasedChartComponent } from "./series.based.chart.component";
4
3
  import * as i0 from "@angular/core";
5
4
  /**
6
5
  * Options for an area chart
6
+ * @group Charts
7
7
  */
8
8
  export interface AreaChartComponentOptions extends Omit<AreaChartOptions, "data" | "url" | "model"> {
9
9
  }
10
- export declare class AreaChartComponent implements AfterViewInit, OnDestroy {
10
+ /**
11
+ * An area chart. Data can be sourced from a url or a JS object, or, if you want to use the chart as part of a dashboard, from the current model provisioned by the VisuallyJsService.
12
+ * @group Charts
13
+ */
14
+ export declare class AreaChartComponent extends SeriesBasedChartComponent<AreaChart, AreaChartOptions, AreaChartComponentOptions> {
11
15
  /**
12
16
  * Optional data to load into the chart
13
17
  * @input
@@ -22,22 +26,13 @@ export declare class AreaChartComponent implements AfterViewInit, OnDestroy {
22
26
  * Options for the chart
23
27
  * @input
24
28
  */
25
- options: AreaChartComponentOptions;
29
+ options: AreaChartOptions;
26
30
  /**
27
31
  * If true, the component attaches to a model provided by the VisuallyJsService. Defaults to false.
28
32
  * @input
29
33
  */
30
34
  useModel?: boolean;
31
- $vjs: VisuallyJsService;
32
- private chart;
33
- $el: ElementRef<any>;
34
- $ngZone: NgZone;
35
- private _init;
36
- /**
37
- * @internal
38
- */
39
- ngAfterViewInit(): void;
40
- ngOnDestroy(): void;
35
+ createChart(el: BrowserElement, options: AreaChartOptions): AreaChart;
41
36
  static ɵfac: i0.ɵɵFactoryDeclaration<AreaChartComponent, never>;
42
37
  static ɵcmp: i0.ɵɵComponentDeclaration<AreaChartComponent, "vjs-area-chart", never, { "data": { "alias": "data"; "required": false; }; "url": { "alias": "url"; "required": false; }; "options": { "alias": "options"; "required": false; }; "useModel": { "alias": "useModel"; "required": false; }; }, {}, never, never, false, never>;
43
38
  }
@@ -1,10 +1,13 @@
1
- import { AfterViewInit, ElementRef, NgZone, OnDestroy } from "@angular/core";
2
- import { BarChartOptions, ObjectData } from "@visuallyjs/browser-ui";
3
- import { VisuallyJsService } from "../vjs-service";
1
+ import { BarChart, BarChartOptions, BrowserElement, ObjectData } from "@visuallyjs/browser-ui";
2
+ import { SeriesBasedChartComponent } from "./series.based.chart.component";
4
3
  import * as i0 from "@angular/core";
5
4
  export interface BarChartComponentOptions extends Omit<BarChartOptions, "data" | "url" | "model"> {
6
5
  }
7
- export declare class BarChartComponent implements AfterViewInit, OnDestroy {
6
+ /**
7
+ * A bar chart. Data can be sourced from a url or a JS object, or, if you want to use the chart as part of a dashboard, from the current model provisioned by the VisuallyJsService.
8
+ * @group Charts
9
+ */
10
+ export declare class BarChartComponent extends SeriesBasedChartComponent<BarChart, BarChartOptions, BarChartComponentOptions> {
8
11
  /**
9
12
  * Optional data to load into the chart
10
13
  * @input
@@ -19,22 +22,13 @@ export declare class BarChartComponent implements AfterViewInit, OnDestroy {
19
22
  * Options for the chart
20
23
  * @input
21
24
  */
22
- options: BarChartComponentOptions;
25
+ options: BarChartOptions;
23
26
  /**
24
27
  * If true, the component attaches to a model provided by the VisuallyJsService. Defaults to false.
25
28
  * @input
26
29
  */
27
30
  useModel?: boolean;
28
- $vjs: VisuallyJsService;
29
- private chart;
30
- $el: ElementRef<any>;
31
- $ngZone: NgZone;
32
- private _init;
33
- /**
34
- * @internal
35
- */
36
- ngAfterViewInit(): void;
37
- ngOnDestroy(): void;
31
+ createChart(el: BrowserElement, options: BarChartOptions): BarChart;
38
32
  static ɵfac: i0.ɵɵFactoryDeclaration<BarChartComponent, never>;
39
33
  static ɵcmp: i0.ɵɵComponentDeclaration<BarChartComponent, "vjs-bar-chart", never, { "data": { "alias": "data"; "required": false; }; "url": { "alias": "url"; "required": false; }; "options": { "alias": "options"; "required": false; }; "useModel": { "alias": "useModel"; "required": false; }; }, {}, never, never, false, never>;
40
34
  }
@@ -1,10 +1,16 @@
1
- import { AfterViewInit, ElementRef, NgZone, OnDestroy } from "@angular/core";
2
- import { BubbleChartOptions, ObjectData } from "@visuallyjs/browser-ui";
3
- import { VisuallyJsService } from "../vjs-service";
1
+ import { BrowserElement, BubbleChart, BubbleChartOptions, ObjectData } from "@visuallyjs/browser-ui";
2
+ import { SeriesBasedChartComponent } from "./series.based.chart.component";
4
3
  import * as i0 from "@angular/core";
4
+ /**
5
+ * Options for a bubble chart.
6
+ */
5
7
  export interface BubbleChartComponentOptions extends Omit<BubbleChartOptions, "data" | "url" | "model"> {
6
8
  }
7
- export declare class BubbleChartComponent implements AfterViewInit, OnDestroy {
9
+ /**
10
+ * A bubble chart. Data can be sourced from a url or a JS object, or, if you want to use the chart as part of a dashboard, from the current model provisioned by the VisuallyJsService.
11
+ * @group Charts
12
+ */
13
+ export declare class BubbleChartComponent extends SeriesBasedChartComponent<BubbleChart, BubbleChartOptions, BubbleChartComponentOptions> {
8
14
  /**
9
15
  * Optional data to load into the chart
10
16
  * @input
@@ -19,22 +25,13 @@ export declare class BubbleChartComponent implements AfterViewInit, OnDestroy {
19
25
  * Options for the chart
20
26
  * @input
21
27
  */
22
- options: BubbleChartComponentOptions;
28
+ options: BubbleChartOptions;
23
29
  /**
24
30
  * If true, the component attaches to a model provided by the VisuallyJsService. Defaults to false.
25
31
  * @input
26
32
  */
27
33
  useModel?: boolean;
28
- private chart;
29
- $el: ElementRef<any>;
30
- $ngZone: NgZone;
31
- $vjs: VisuallyJsService;
32
- private _init;
33
- /**
34
- * @internal
35
- */
36
- ngAfterViewInit(): void;
37
- ngOnDestroy(): void;
34
+ createChart(el: BrowserElement, options: BubbleChartOptions): BubbleChart;
38
35
  static ɵfac: i0.ɵɵFactoryDeclaration<BubbleChartComponent, never>;
39
36
  static ɵcmp: i0.ɵɵComponentDeclaration<BubbleChartComponent, "vjs-bubble-chart", never, { "data": { "alias": "data"; "required": false; }; "url": { "alias": "url"; "required": false; }; "options": { "alias": "options"; "required": false; }; "useModel": { "alias": "useModel"; "required": false; }; }, {}, never, never, false, never>;
40
37
  }
@@ -1,10 +1,16 @@
1
- import { AfterViewInit, ElementRef, NgZone, OnDestroy } from "@angular/core";
2
- import { ColumnChartOptions, ObjectData } from "@visuallyjs/browser-ui";
3
- import { VisuallyJsService } from "../vjs-service";
1
+ import { BrowserElement, ColumnChart, ColumnChartOptions, ObjectData } from "@visuallyjs/browser-ui";
2
+ import { SeriesBasedChartComponent } from "./series.based.chart.component";
4
3
  import * as i0 from "@angular/core";
4
+ /**
5
+ * Options for a column chart.
6
+ */
5
7
  export interface ColumnChartComponentOptions extends Omit<ColumnChartOptions, "data" | "url" | "model"> {
6
8
  }
7
- export declare class ColumnChartComponent implements AfterViewInit, OnDestroy {
9
+ /**
10
+ * A column chart. Data can be sourced from a url or a JS object, or, if you want to use the chart as part of a dashboard, from the current model provisioned by the VisuallyJsService.
11
+ * @group Charts
12
+ */
13
+ export declare class ColumnChartComponent extends SeriesBasedChartComponent<ColumnChart, ColumnChartOptions, ColumnChartComponentOptions> {
8
14
  /**
9
15
  * Optional data to load into the chart
10
16
  * @input
@@ -19,22 +25,13 @@ export declare class ColumnChartComponent implements AfterViewInit, OnDestroy {
19
25
  * Options for the chart
20
26
  * @input
21
27
  */
22
- options: ColumnChartComponentOptions;
28
+ options: ColumnChartOptions;
23
29
  /**
24
30
  * If true, the component attaches to a model provided by the VisuallyJsService. Defaults to false.
25
31
  * @input
26
32
  */
27
33
  useModel?: boolean;
28
- private chart;
29
- $el: ElementRef<any>;
30
- $ngZone: NgZone;
31
- $vjs: VisuallyJsService;
32
- private _init;
33
- /**
34
- * @internal
35
- */
36
- ngAfterViewInit(): void;
37
- ngOnDestroy(): void;
34
+ createChart(el: BrowserElement, options: ColumnChartOptions): ColumnChart;
38
35
  static ɵfac: i0.ɵɵFactoryDeclaration<ColumnChartComponent, never>;
39
36
  static ɵcmp: i0.ɵɵComponentDeclaration<ColumnChartComponent, "vjs-column-chart", never, { "data": { "alias": "data"; "required": false; }; "url": { "alias": "url"; "required": false; }; "options": { "alias": "options"; "required": false; }; "useModel": { "alias": "useModel"; "required": false; }; }, {}, never, never, false, never>;
40
37
  }
@@ -1,39 +1,38 @@
1
- import { AfterViewInit, ElementRef, NgZone, OnDestroy } from "@angular/core";
2
- import { LineChartOptions, ObjectData } from "@visuallyjs/browser-ui";
3
- import { VisuallyJsService } from "../vjs-service";
1
+ import { BrowserElement, LineChart, LineChartOptions, ObjectData } from "@visuallyjs/browser-ui";
2
+ import { SeriesBasedChartComponent } from "./series.based.chart.component";
4
3
  import * as i0 from "@angular/core";
4
+ /**
5
+ * Options for a line chart
6
+ * @group Charts
7
+ */
5
8
  export interface LineChartComponentOptions extends Omit<LineChartOptions, "data" | "url" | "model"> {
6
9
  }
7
- export declare class LineChartComponent implements AfterViewInit, OnDestroy {
10
+ /**
11
+ * A line chart. Data can be sourced from a url or a JS object, or, if you want to use the chart as part of a dashboard, from the current model provisioned by the VisuallyJsService.
12
+ * @group Charts
13
+ */
14
+ export declare class LineChartComponent extends SeriesBasedChartComponent<LineChart, LineChartOptions, LineChartComponentOptions> {
8
15
  /**
9
16
  * Optional data to load into the chart
10
- *
17
+ * @input
11
18
  */
12
19
  data?: Array<ObjectData>;
13
20
  /**
14
21
  * Optional URL for data to load into the chart
15
- *
22
+ * @input
16
23
  */
17
24
  url?: string;
18
25
  /**
19
26
  * Options for the chart
27
+ * @input
20
28
  */
21
- options: LineChartComponentOptions;
29
+ options: LineChartOptions;
22
30
  /**
23
31
  * If true, the component attaches to a model provided by the VisuallyJsService. Defaults to false.
24
32
  * @input
25
33
  */
26
34
  useModel?: boolean;
27
- private chart;
28
- $el: ElementRef<any>;
29
- $ngZone: NgZone;
30
- $vjs: VisuallyJsService;
31
- private _init;
32
- /**
33
- * @internal
34
- */
35
- ngAfterViewInit(): void;
36
- ngOnDestroy(): void;
35
+ createChart(el: BrowserElement, options: LineChartOptions): LineChart;
37
36
  static ɵfac: i0.ɵɵFactoryDeclaration<LineChartComponent, never>;
38
37
  static ɵcmp: i0.ɵɵComponentDeclaration<LineChartComponent, "vjs-line-chart", never, { "data": { "alias": "data"; "required": false; }; "url": { "alias": "url"; "required": false; }; "options": { "alias": "options"; "required": false; }; "useModel": { "alias": "useModel"; "required": false; }; }, {}, never, never, false, never>;
39
38
  }
@@ -1,10 +1,13 @@
1
- import { AfterViewInit, ElementRef, NgZone, OnDestroy } from "@angular/core";
2
- import { PieChartOptions, ObjectData } from "@visuallyjs/browser-ui";
3
- import { VisuallyJsService } from "../vjs-service";
1
+ import { PieChart, PieChartOptions, BrowserElement, ObjectData } from "@visuallyjs/browser-ui";
2
+ import { SeriesBasedChartComponent } from "./series.based.chart.component";
4
3
  import * as i0 from "@angular/core";
5
4
  export interface PieChartComponentOptions extends Omit<PieChartOptions, "data" | "url" | "model"> {
6
5
  }
7
- export declare class PieChartComponent implements AfterViewInit, OnDestroy {
6
+ /**
7
+ * A Pie chart.
8
+ * @group Charts
9
+ */
10
+ export declare class PieChartComponent extends SeriesBasedChartComponent<PieChart, PieChartOptions, PieChartComponentOptions> {
8
11
  /**
9
12
  * Optional data to load into the chart
10
13
  * @input
@@ -19,22 +22,13 @@ export declare class PieChartComponent implements AfterViewInit, OnDestroy {
19
22
  * Options for the chart
20
23
  * @input
21
24
  */
22
- options: PieChartComponentOptions;
25
+ options: PieChartOptions;
23
26
  /**
24
27
  * If true, the component attaches to a model provided by the VisuallyJsService. Defaults to false.
25
28
  * @input
26
29
  */
27
30
  useModel?: boolean;
28
- private chart;
29
- $el: ElementRef<any>;
30
- $ngZone: NgZone;
31
- $vjs: VisuallyJsService;
32
- private _init;
33
- /**
34
- * @internal
35
- */
36
- ngAfterViewInit(): void;
37
- ngOnDestroy(): void;
31
+ createChart(el: BrowserElement, options: PieChartOptions): PieChart;
38
32
  static ɵfac: i0.ɵɵFactoryDeclaration<PieChartComponent, never>;
39
33
  static ɵcmp: i0.ɵɵComponentDeclaration<PieChartComponent, "vjs-pie-chart", never, { "data": { "alias": "data"; "required": false; }; "url": { "alias": "url"; "required": false; }; "options": { "alias": "options"; "required": false; }; "useModel": { "alias": "useModel"; "required": false; }; }, {}, never, never, false, never>;
40
34
  }
@@ -4,6 +4,10 @@ import { VisuallyJsService } from "../vjs-service";
4
4
  import * as i0 from "@angular/core";
5
5
  export interface SankeyChartComponentOptions extends Omit<SankeyOptions, "data" | "url" | "model"> {
6
6
  }
7
+ /**
8
+ * A sankey chart. Data can be sourced from a url or a JS object, or, if you want to use the chart as part of a dashboard, from the current model provisioned by the VisuallyJsService.
9
+ * @group Charts
10
+ */
7
11
  export declare class SankeyChartComponent implements AfterViewInit, OnDestroy, OnChanges {
8
12
  /**
9
13
  * Optional data to load into the chart (in CSV format)
@@ -44,6 +48,7 @@ export declare class SankeyChartComponent implements AfterViewInit, OnDestroy, O
44
48
  $el: ElementRef<any>;
45
49
  $ngZone: NgZone;
46
50
  $vjs: VisuallyJsService;
51
+ constructor();
47
52
  /**
48
53
  * @internal
49
54
  */
@@ -1,10 +1,13 @@
1
- import { AfterViewInit, ElementRef, NgZone, OnDestroy } from "@angular/core";
2
- import { ScatterChartOptions, ObjectData } from "@visuallyjs/browser-ui";
3
- import { VisuallyJsService } from "../vjs-service";
1
+ import { ScatterChart, ScatterChartOptions, BrowserElement, ObjectData } from "@visuallyjs/browser-ui";
2
+ import { SeriesBasedChartComponent } from "./series.based.chart.component";
4
3
  import * as i0 from "@angular/core";
5
4
  export interface ScatterChartComponentOptions extends Omit<ScatterChartOptions, "data" | "url" | "model"> {
6
5
  }
7
- export declare class ScatterChartComponent implements AfterViewInit, OnDestroy {
6
+ /**
7
+ * A scatter chart. Data can be sourced from a url or a JS object, or, if you want to use the chart as part of a dashboard, from the current model provisioned by the VisuallyJsService.
8
+ * @group Charts
9
+ */
10
+ export declare class ScatterChartComponent extends SeriesBasedChartComponent<ScatterChart, ScatterChartOptions, ScatterChartComponentOptions> {
8
11
  /**
9
12
  * Optional data to load into the chart
10
13
  * @input
@@ -19,22 +22,13 @@ export declare class ScatterChartComponent implements AfterViewInit, OnDestroy {
19
22
  * Options for the chart
20
23
  * @input
21
24
  */
22
- options: ScatterChartComponentOptions;
25
+ options: ScatterChartOptions;
23
26
  /**
24
27
  * If true, the component attaches to a model provided by the VisuallyJsService. Defaults to false.
25
28
  * @input
26
29
  */
27
30
  useModel?: boolean;
28
- private chart;
29
- $el: ElementRef<any>;
30
- $ngZone: NgZone;
31
- $vjs: VisuallyJsService;
32
- private _init;
33
- /**
34
- * @internal
35
- */
36
- ngAfterViewInit(): void;
37
- ngOnDestroy(): void;
31
+ createChart(el: BrowserElement, options: ScatterChartOptions): ScatterChart;
38
32
  static ɵfac: i0.ɵɵFactoryDeclaration<ScatterChartComponent, never>;
39
33
  static ɵcmp: i0.ɵɵComponentDeclaration<ScatterChartComponent, "vjs-scatter-chart", never, { "data": { "alias": "data"; "required": false; }; "url": { "alias": "url"; "required": false; }; "options": { "alias": "options"; "required": false; }; "useModel": { "alias": "useModel"; "required": false; }; }, {}, never, never, false, never>;
40
34
  }
@@ -0,0 +1,44 @@
1
+ import { BrowserElement, ObjectData } from "@visuallyjs/browser-ui";
2
+ import { AfterViewInit, ElementRef, NgZone, OnDestroy } from "@angular/core";
3
+ import { VisuallyJsService } from "../vjs-service";
4
+ import { SeriesBasedChart } from "@visuallyjs/browser-ui/types/charts/series-based-chart";
5
+ import * as i0 from "@angular/core";
6
+ /**
7
+ * Parent component for xy charts.
8
+ */
9
+ export declare abstract class SeriesBasedChartComponent<T extends SeriesBasedChart<O>, O, CO> implements AfterViewInit, OnDestroy {
10
+ /**
11
+ * Optional data to load into the chart
12
+ * @input
13
+ */
14
+ data?: Array<ObjectData>;
15
+ /**
16
+ * Optional URL for data to load into the chart
17
+ * @input
18
+ */
19
+ url?: string;
20
+ /**
21
+ * Options for the chart
22
+ * @input
23
+ */
24
+ options: CO;
25
+ /**
26
+ * If true, the component attaches to a model provided by the VisuallyJsService. Defaults to false.
27
+ * @input
28
+ */
29
+ useModel?: boolean;
30
+ private chart;
31
+ $el: ElementRef<any>;
32
+ $ngZone: NgZone;
33
+ $vjs: VisuallyJsService;
34
+ private _init;
35
+ constructor();
36
+ /**
37
+ * @internal
38
+ */
39
+ ngAfterViewInit(): void;
40
+ ngOnDestroy(): void;
41
+ abstract createChart(el: BrowserElement, options: O): T;
42
+ static ɵfac: i0.ɵɵFactoryDeclaration<SeriesBasedChartComponent<any, any, any>, never>;
43
+ static ɵprov: i0.ɵɵInjectableDeclaration<SeriesBasedChartComponent<any, any, any>>;
44
+ }
@@ -1,9 +1,13 @@
1
- import { AfterViewInit, ElementRef, NgZone, OnDestroy } from "@angular/core";
2
- import { CategoryValueChartOptions, ObjectData } from "@visuallyjs/browser-ui";
1
+ import { BrowserElement, CategoryValueChart, CategoryValueChartOptions, ObjectData } from "@visuallyjs/browser-ui";
2
+ import { SeriesBasedChartComponent } from "./series.based.chart.component";
3
3
  import * as i0 from "@angular/core";
4
4
  export interface XYChartComponentOptions extends Omit<CategoryValueChartOptions, "data" | "url" | "model"> {
5
5
  }
6
- export declare class XYChartComponent implements AfterViewInit, OnDestroy {
6
+ /**
7
+ * A generic category/value charts
8
+ * @group Charts
9
+ */
10
+ export declare class XYChartComponent extends SeriesBasedChartComponent<CategoryValueChart, CategoryValueChartOptions, XYChartComponentOptions> {
7
11
  /**
8
12
  * Optional data to load into the chart
9
13
  * @input
@@ -18,15 +22,13 @@ export declare class XYChartComponent implements AfterViewInit, OnDestroy {
18
22
  * Options for the chart
19
23
  * @input
20
24
  */
21
- options: XYChartComponentOptions;
22
- private chart;
23
- $el: ElementRef<any>;
24
- $ngZone: NgZone;
25
+ options: CategoryValueChartOptions;
25
26
  /**
26
- * @internal
27
+ * If true, the component attaches to a model provided by the VisuallyJsService. Defaults to false.
28
+ * @input
27
29
  */
28
- ngAfterViewInit(): void;
29
- ngOnDestroy(): void;
30
+ useModel?: boolean;
31
+ createChart(el: BrowserElement, options: CategoryValueChartOptions): CategoryValueChart;
30
32
  static ɵfac: i0.ɵɵFactoryDeclaration<XYChartComponent, never>;
31
- static ɵcmp: i0.ɵɵComponentDeclaration<XYChartComponent, "vjs-xy-chart", never, { "data": { "alias": "data"; "required": false; }; "url": { "alias": "url"; "required": false; }; "options": { "alias": "options"; "required": false; }; }, {}, never, never, false, never>;
33
+ static ɵcmp: i0.ɵɵComponentDeclaration<XYChartComponent, "vjs-xy-chart", never, { "data": { "alias": "data"; "required": false; }; "url": { "alias": "url"; "required": false; }; "options": { "alias": "options"; "required": false; }; "useModel": { "alias": "useModel"; "required": false; }; }, {}, never, never, false, never>;
32
34
  }
@@ -1,12 +1,11 @@
1
- import { AfterViewInit, ElementRef, EventEmitter, ChangeDetectorRef } from "@angular/core";
1
+ import { ElementRef, EventEmitter, ChangeDetectorRef } from "@angular/core";
2
2
  import { VisuallyJsService } from "./vjs-service";
3
3
  import * as i0 from "@angular/core";
4
4
  /**
5
- * A helper component that offers the ability to change color and keep a history of selected colors, for
6
- * use in an {@link InspectorComponent}
5
+ * A helper component that offers the ability to change color and keep a history of selected colors, for use in an {@link InspectorComponent}
7
6
  * @group Components
8
7
  */
9
- export declare class ColorPickerComponent implements AfterViewInit {
8
+ export declare class ColorPickerComponent {
10
9
  /**
11
10
  * The name of the property that maps the color. Required.
12
11
  * @input
@@ -26,10 +25,11 @@ export declare class ColorPickerComponent implements AfterViewInit {
26
25
  $vjs: VisuallyJsService;
27
26
  $el: ElementRef<any>;
28
27
  $cdr: ChangeDetectorRef;
28
+ initialized: boolean;
29
+ constructor();
29
30
  private $getInspector;
30
31
  selectColor(color: string): void;
31
32
  private pushColor;
32
- ngAfterViewInit(): void;
33
33
  static ɵfac: i0.ɵɵFactoryDeclaration<ColorPickerComponent, never>;
34
34
  static ɵcmp: i0.ɵɵComponentDeclaration<ColorPickerComponent, "vjs-color", never, { "propertyName": { "alias": "propertyName"; "required": false; }; "maxColors": { "alias": "maxColors"; "required": false; }; }, { "changeEvent": "changeEvent"; }, never, never, false, never>;
35
35
  }
@@ -1,4 +1,4 @@
1
- import { ChangeDetectorRef, ElementRef, OnInit } from "@angular/core";
1
+ import { ChangeDetectorRef, ElementRef } from "@angular/core";
2
2
  import { ControlsComponentButtons, BrowserElement, BrowserUI } from "@visuallyjs/browser-ui";
3
3
  import { VisuallyJsService } from "./vjs-service";
4
4
  import * as i0 from "@angular/core";
@@ -10,7 +10,7 @@ import * as i0 from "@angular/core";
10
10
  * press the 'clear' button is in English, as are the button tooltips.
11
11
  * @group Components
12
12
  */
13
- export declare class ControlsComponent implements OnInit {
13
+ export declare class ControlsComponent {
14
14
  /**
15
15
  * Whether or not to show undo/redo buttons. Defaults to true.
16
16
  * @input
@@ -48,14 +48,16 @@ export declare class ControlsComponent implements OnInit {
48
48
  orientation?: string;
49
49
  modeButtons: ControlsComponentButtons;
50
50
  otherButtons: ControlsComponentButtons;
51
- ui: BrowserUI;
51
+ initialized: boolean;
52
52
  showPanButton: boolean;
53
53
  showLassoButton: boolean;
54
54
  $vjs: VisuallyJsService;
55
55
  $el: ElementRef<any>;
56
56
  $cdr: ChangeDetectorRef;
57
+ ui: import("@angular/core").WritableSignal<BrowserUI<any>>;
58
+ model: import("@angular/core").Signal<import("@visuallyjs/browser-ui").VisuallyJsModel>;
57
59
  updateSelectionState(): void;
58
- ngOnInit(): void;
60
+ constructor();
59
61
  getNativeElement(component: any): BrowserElement;
60
62
  panMode(): void;
61
63
  selectMode(): void;
@@ -2,6 +2,10 @@ import { Diagram, DiagramCell, Size, PaletteMode, OnVertexAddedCallback, Prepare
2
2
  import { AfterViewInit, ElementRef } from "@angular/core";
3
3
  import { VisuallyJsService } from "./vjs-service";
4
4
  import * as i0 from "@angular/core";
5
+ /**
6
+ * Provides a palette for a diagram.
7
+ * @group Components
8
+ */
5
9
  export declare class DiagramPaletteComponent implements AfterViewInit {
6
10
  /**
7
11
  * Optional fill color to use for dragged elements. This should be in RGB format, _not_ a color like 'white' or 'cyan' etc.
@@ -72,7 +76,7 @@ export declare class DiagramPaletteComponent implements AfterViewInit {
72
76
  * Optional diagram to attach to. It is not generally necessary to supply this as it will be retrieved from the context.
73
77
  * @input
74
78
  */
75
- diagram?: Diagram;
79
+ inputDiagram?: Diagram;
76
80
  /**
77
81
  * Optional callback that will be invoked after a new vertex has been dropped and added to the dataset.
78
82
  * @input
@@ -85,8 +89,10 @@ export declare class DiagramPaletteComponent implements AfterViewInit {
85
89
  preparedShapes?: Array<PreparedShape>;
86
90
  $el: ElementRef<any>;
87
91
  $vjs: VisuallyJsService;
92
+ initialized: boolean;
88
93
  private $init;
94
+ constructor();
89
95
  ngAfterViewInit(): void;
90
96
  static ɵfac: i0.ɵɵFactoryDeclaration<DiagramPaletteComponent, never>;
91
- static ɵcmp: i0.ɵɵComponentDeclaration<DiagramPaletteComponent, "vjs-diagram-palette", never, { "fill": { "alias": "fill"; "required": false; }; "outline": { "alias": "outline"; "required": false; }; "dragSize": { "alias": "dragSize"; "required": false; }; "inspector": { "alias": "inspector"; "required": false; }; "iconSize": { "alias": "iconSize"; "required": false; }; "showLabels": { "alias": "showLabels"; "required": false; }; "paletteStrokeWidth": { "alias": "paletteStrokeWidth"; "required": false; }; "showAllMessage": { "alias": "showAllMessage"; "required": false; }; "onCellAdded": { "alias": "onCellAdded"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "allowClickToAdd": { "alias": "allowClickToAdd"; "required": false; }; "autoExitDrawMode": { "alias": "autoExitDrawMode"; "required": false; }; "selectAfterAdd": { "alias": "selectAfterAdd"; "required": false; }; "diagram": { "alias": "diagram"; "required": false; }; "onVertexAdded": { "alias": "onVertexAdded"; "required": false; }; "preparedShapes": { "alias": "preparedShapes"; "required": false; }; }, {}, never, never, false, never>;
97
+ static ɵcmp: i0.ɵɵComponentDeclaration<DiagramPaletteComponent, "vjs-diagram-palette", never, { "fill": { "alias": "fill"; "required": false; }; "outline": { "alias": "outline"; "required": false; }; "dragSize": { "alias": "dragSize"; "required": false; }; "inspector": { "alias": "inspector"; "required": false; }; "iconSize": { "alias": "iconSize"; "required": false; }; "showLabels": { "alias": "showLabels"; "required": false; }; "paletteStrokeWidth": { "alias": "paletteStrokeWidth"; "required": false; }; "showAllMessage": { "alias": "showAllMessage"; "required": false; }; "onCellAdded": { "alias": "onCellAdded"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "allowClickToAdd": { "alias": "allowClickToAdd"; "required": false; }; "autoExitDrawMode": { "alias": "autoExitDrawMode"; "required": false; }; "selectAfterAdd": { "alias": "selectAfterAdd"; "required": false; }; "inputDiagram": { "alias": "diagram"; "required": false; }; "onVertexAdded": { "alias": "onVertexAdded"; "required": false; }; "preparedShapes": { "alias": "preparedShapes"; "required": false; }; }, {}, never, never, false, never>;
92
98
  }
@@ -1,4 +1,4 @@
1
- import { AfterViewInit, ElementRef, EventEmitter } from "@angular/core";
1
+ import { ElementRef, EventEmitter } from "@angular/core";
2
2
  import { EdgePropertyMappings, Inspector } from "@visuallyjs/browser-ui";
3
3
  import { VisuallyJsService } from "./vjs-service";
4
4
  import * as i0 from "@angular/core";
@@ -6,7 +6,7 @@ import * as i0 from "@angular/core";
6
6
  * A helper component that wraps an EdgeTypePicker, for use in an {@link InspectorComponent}
7
7
  * @group Components
8
8
  */
9
- export declare class EdgeTypePickerComponent implements AfterViewInit {
9
+ export declare class EdgeTypePickerComponent {
10
10
  private el;
11
11
  /**
12
12
  * The name of the property that maps the edge type. Required.
@@ -26,10 +26,10 @@ export declare class EdgeTypePickerComponent implements AfterViewInit {
26
26
  changeEvent: EventEmitter<string>;
27
27
  private edgeTypePicker;
28
28
  $vjs: VisuallyJsService;
29
- inspector: Inspector;
30
- constructor(el: ElementRef);
29
+ _inspector: import("@angular/core").WritableSignal<Inspector>;
30
+ initialised: boolean;
31
31
  private resolveMappings;
32
- ngAfterViewInit(): void;
32
+ constructor(el: ElementRef);
33
33
  static ɵfac: i0.ɵɵFactoryDeclaration<EdgeTypePickerComponent, never>;
34
34
  static ɵcmp: i0.ɵɵComponentDeclaration<EdgeTypePickerComponent, "vjs-edge-type", never, { "propertyName": { "alias": "propertyName"; "required": false; }; "edgeMappings": { "alias": "edgeMappings"; "required": false; }; }, { "changeEvent": "changeEvent"; }, never, never, false, never>;
35
35
  }
@@ -1,11 +1,11 @@
1
- import { ElementRef, OnInit } from "@angular/core";
2
- import { BrowserUI, ImageExportUIOptions, PointXY, SvgExportUIOptions } from "@visuallyjs/browser-ui";
1
+ import { ElementRef } from "@angular/core";
2
+ import { ImageExportUIOptions, PointXY, SvgExportUIOptions } from "@visuallyjs/browser-ui";
3
3
  import { VisuallyJsService } from "./vjs-service";
4
4
  import * as i0 from "@angular/core";
5
5
  /**
6
6
  * @group Components
7
7
  */
8
- export declare class ExportControlsComponent implements OnInit {
8
+ export declare class ExportControlsComponent {
9
9
  /**
10
10
  * Whether or not to show a label in front of the buttons. Defaults to true.
11
11
  * @input
@@ -46,11 +46,11 @@ export declare class ExportControlsComponent implements OnInit {
46
46
  * @input
47
47
  */
48
48
  allowJpgExport?: boolean;
49
- /** @internal */
50
- ui: BrowserUI;
51
49
  $vjs: VisuallyJsService;
52
50
  $el: ElementRef<any>;
53
- ngOnInit(): void;
51
+ /** @internal */
52
+ ui: import("@angular/core").WritableSignal<import("@visuallyjs/browser-ui").BrowserUI<any>>;
53
+ model: import("@angular/core").Signal<import("@visuallyjs/browser-ui").VisuallyJsModel>;
54
54
  exportSVG(): void;
55
55
  exportPNG(): void;
56
56
  exportJPG(): void;
@@ -0,0 +1,21 @@
1
+ import { BrowserUIModel } from "@visuallyjs/browser-ui";
2
+ /**
3
+ * Simple hook that responds to all update events in the model, including when the model is cleared. You pass in a function that takes the model as argument, and that should be invoked when an update/clear event occurs. The function is also invoked when the initial model reference is obtained.
4
+ *
5
+ * ```typescript
6
+ * import { useVisuallyJsUpdate } from "@visuallyjs/browser-ui-angular"
7
+ *
8
+ * @Component({
9
+ * ...
10
+ * })
11
+ * export class MyComponent {
12
+ * constructor() {
13
+ * useVisuallyJsUpdate((model) => console.log("Model updated", model.getNodeCount()))
14
+ * }
15
+ * }
16
+ * ```
17
+ *
18
+ * @param callback Callback to invoke when an update occurs.
19
+ * @group Hooks
20
+ */
21
+ export declare function useVisuallyJsUpdate(callback: (model: BrowserUIModel) => any): void;
@@ -0,0 +1,6 @@
1
+ import { Signal } from "@angular/core";
2
+ /**
3
+ * Provides a signal that exposes the zoom for the given Surface.
4
+ * @group Hooks
5
+ */
6
+ export declare function useZoom(): Signal<number>;