@cehlers88/chart 1.0.3 → 1.0.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/README.md +6 -6
- package/dist/Camera.d.ts +22 -0
- package/dist/ChartEngine.d.ts +10 -2
- package/dist/Factory/DataGroupFactory.d.ts +3 -0
- package/dist/Registry/DiagramRegistry.d.ts +16 -0
- package/dist/Registry/EntityRegistry.d.ts +14 -0
- package/dist/customElement/CanvasDiagram.d.ts +19 -0
- package/dist/index.d.ts +16 -6
- package/dist/index.js +256 -14
- package/dist/interface/ICanvasDiagram.d.ts +4 -0
- package/dist/interface/IChartEntity.d.ts +7 -0
- package/dist/interface/IChartPlugin.d.ts +17 -4
- package/dist/plugin/AbstractDiagramPlugin.d.ts +13 -0
- package/dist/plugin/AbstractPlugin.d.ts +58 -0
- package/dist/plugin/BarsPlugin.d.ts +16 -10
- package/dist/plugin/CameraMove.d.ts +25 -0
- package/dist/plugin/DiagramLine.d.ts +19 -6
- package/dist/plugin/EnrichGroupInfosPlugin.d.ts +7 -3
- package/dist/plugin/LegendsPlugin.d.ts +19 -0
- package/dist/plugin/PaginationPlugin.d.ts +25 -0
- package/dist/plugin/TimelinePlugin.d.ts +31 -0
- package/dist/plugin/TooltipPlugin.d.ts +14 -0
- package/dist/type/TData.d.ts +2 -0
- package/package.json +14 -4
- package/dist/plugin/AbstractChartPlugin.d.ts +0 -23
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Chart
|
|
2
|
-
A library to create charts using JavaScript and Canvas-Element.
|
|
3
|
-
|
|
4
|
-
## Examples
|
|
5
|
-
######`javascipt`
|
|
6
|
-
const obj = new ChartEngine(element);
|
|
1
|
+
# Chart
|
|
2
|
+
A library to create charts using JavaScript and Canvas-Element.
|
|
3
|
+
|
|
4
|
+
## Examples
|
|
5
|
+
######`javascipt`
|
|
6
|
+
const obj = new ChartEngine(element);
|
package/dist/Camera.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { canvasLib } from "@cehlers88/ceutils";
|
|
2
|
+
declare class Camera extends canvasLib.Vector2D {
|
|
3
|
+
private _destination;
|
|
4
|
+
private _speed;
|
|
5
|
+
private _destinationXReached;
|
|
6
|
+
private _destinationXCallback;
|
|
7
|
+
private _destinationYReached;
|
|
8
|
+
private _destinationYCallback;
|
|
9
|
+
private _maxPos;
|
|
10
|
+
constructor();
|
|
11
|
+
setDestinationX(x: number, callback?: () => void): Camera;
|
|
12
|
+
setDestinationY(y: number, callback?: () => void): Camera;
|
|
13
|
+
update(deltaTime: number): void;
|
|
14
|
+
getMaxX(): number;
|
|
15
|
+
getMaxY(): number;
|
|
16
|
+
setSpeed(speed: number): Camera;
|
|
17
|
+
setMaxX(x: number): Camera;
|
|
18
|
+
setMaxY(y: number): Camera;
|
|
19
|
+
getX(): number;
|
|
20
|
+
getY(): number;
|
|
21
|
+
}
|
|
22
|
+
export default Camera;
|
package/dist/ChartEngine.d.ts
CHANGED
|
@@ -7,20 +7,28 @@
|
|
|
7
7
|
import { IChartPlugin } from "./interface/IChartPlugin";
|
|
8
8
|
import { TDataGroup } from "./type/TDataGroup";
|
|
9
9
|
import { IChartEngine } from "./interface/IChartEngine";
|
|
10
|
+
import { TRect } from "./type/TRect";
|
|
10
11
|
export default class ChartEngine implements IChartEngine {
|
|
12
|
+
private _camera;
|
|
11
13
|
private _canvasElement;
|
|
14
|
+
private _entityRegistry;
|
|
12
15
|
private _ctx;
|
|
13
16
|
private _dataGroups;
|
|
14
17
|
private _plugins;
|
|
15
|
-
|
|
18
|
+
private _pluginProperties;
|
|
19
|
+
constructor(canvasElement: HTMLCanvasElement, properties?: {
|
|
20
|
+
plugins?: IChartPlugin[];
|
|
21
|
+
});
|
|
16
22
|
private getEngineCallbacks;
|
|
17
23
|
addPlugin(plugin: IChartPlugin): ChartEngine;
|
|
24
|
+
getDrawAreaRect(): TRect;
|
|
18
25
|
getPlugin(pluginName: string): IChartPlugin;
|
|
26
|
+
getPlugins(): IChartPlugin[];
|
|
27
|
+
setPluginProperty(propertyName: string, value: any): ChartEngine;
|
|
19
28
|
create(): ChartEngine;
|
|
20
29
|
addDataGroup(dataGroup: TDataGroup): IChartEngine;
|
|
21
30
|
addValue(value: any, groupName?: string): IChartEngine;
|
|
22
31
|
draw(): ChartEngine;
|
|
23
|
-
private drawLegend;
|
|
24
32
|
update(): ChartEngine;
|
|
25
33
|
start(): void;
|
|
26
34
|
}
|
|
@@ -4,4 +4,7 @@ export default class DataGroupFactory {
|
|
|
4
4
|
private static _lastColorIndex;
|
|
5
5
|
static buildCounter: number;
|
|
6
6
|
static createDataGroup(values: any[], groupLabel?: string, color?: string): TDataGroup;
|
|
7
|
+
static parseDataGroupsDefinition(value: string): TDataGroup[];
|
|
8
|
+
static setColor(color: string, index: number): void;
|
|
9
|
+
static setColors(colors: string[]): void;
|
|
7
10
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Library DiagramRegistry
|
|
3
|
+
* Created 03.10.24
|
|
4
|
+
*
|
|
5
|
+
* @author Christoph Ehlers
|
|
6
|
+
*/
|
|
7
|
+
import CanvasDiagram from "../customElement/CanvasDiagram";
|
|
8
|
+
import { ICanvasDiagram } from "../interface/ICanvasDiagram";
|
|
9
|
+
declare class DiagramRegistry {
|
|
10
|
+
private static _identPrefix;
|
|
11
|
+
private createUniqueIdentifier;
|
|
12
|
+
getDiagram(identifier: string): ICanvasDiagram;
|
|
13
|
+
register(diagram: CanvasDiagram, identifier?: string): DiagramRegistry;
|
|
14
|
+
}
|
|
15
|
+
export default DiagramRegistry;
|
|
16
|
+
export declare const diagramRegistry: DiagramRegistry;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Library EntityRegistry
|
|
3
|
+
* Created 03.10.24
|
|
4
|
+
*
|
|
5
|
+
* @author Christoph Ehlers
|
|
6
|
+
*/
|
|
7
|
+
import { IChartEntity } from "../interface/IChartEntity";
|
|
8
|
+
export default class EntityRegistry {
|
|
9
|
+
private _entityStore;
|
|
10
|
+
addEntity(source: string, entity: IChartEntity, identifier?: string): string;
|
|
11
|
+
generateIdentifier(): string;
|
|
12
|
+
getEntity(identifier: string): IChartEntity;
|
|
13
|
+
getEntities(sourceFilter?: string): IChartEntity[];
|
|
14
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Element CanvasDiagram
|
|
3
|
+
* Created 03.10.24
|
|
4
|
+
*
|
|
5
|
+
* @author Christoph Ehlers
|
|
6
|
+
*/
|
|
7
|
+
import '../style/CanvasDiagram.css';
|
|
8
|
+
import { IChartPlugin } from "../interface/IChartPlugin";
|
|
9
|
+
import { ICanvasDiagram } from "../interface/ICanvasDiagram";
|
|
10
|
+
declare class CanvasDiagram extends HTMLElement implements ICanvasDiagram {
|
|
11
|
+
private _cleanDom;
|
|
12
|
+
private _engine;
|
|
13
|
+
connectedCallback(): void;
|
|
14
|
+
addPlugin(plugin: IChartPlugin): ICanvasDiagram;
|
|
15
|
+
private createCanvas;
|
|
16
|
+
private evalArguments;
|
|
17
|
+
start(): ICanvasDiagram;
|
|
18
|
+
}
|
|
19
|
+
export default CanvasDiagram;
|
package/dist/index.d.ts
CHANGED
|
@@ -4,24 +4,34 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @author Christoph Ehlers
|
|
6
6
|
*/
|
|
7
|
-
import
|
|
8
|
-
import DiagramLine from "./plugin/DiagramLine";
|
|
7
|
+
import CanvasDiagramClass from "./customElement/CanvasDiagram";
|
|
9
8
|
import BarsPluginClass from "./plugin/BarsPlugin";
|
|
9
|
+
import ChartEngineClass from './ChartEngine';
|
|
10
10
|
import DataGroupFactoryClass from "./Factory/DataGroupFactory";
|
|
11
|
+
import DiagramLine from "./plugin/DiagramLine";
|
|
12
|
+
import DiagramRegistry from "./Registry/DiagramRegistry";
|
|
13
|
+
import CameraMove from "./plugin/CameraMove";
|
|
14
|
+
import TimelinePlugin from "./plugin/TimelinePlugin";
|
|
15
|
+
export declare const CanvasDiagram: typeof CanvasDiagramClass;
|
|
16
|
+
export declare const ChartEngine: typeof ChartEngineClass;
|
|
17
|
+
export declare const DataGroupFactory: typeof DataGroupFactoryClass;
|
|
18
|
+
export declare const diagramRegistry: DiagramRegistry;
|
|
11
19
|
export declare const plugins: {
|
|
12
20
|
BarsPlugin: typeof BarsPluginClass;
|
|
21
|
+
CameraMovePlugin: typeof CameraMove;
|
|
13
22
|
DiagramLinePlugin: typeof DiagramLine;
|
|
23
|
+
TimelinePlugin: typeof TimelinePlugin;
|
|
14
24
|
};
|
|
15
25
|
declare const _default: {
|
|
26
|
+
CanvasDiagram: typeof CanvasDiagramClass;
|
|
16
27
|
ChartEngine: typeof ChartEngineClass;
|
|
17
28
|
DataGroupFactory: typeof DataGroupFactoryClass;
|
|
29
|
+
diagramRegistry: DiagramRegistry;
|
|
18
30
|
plugins: {
|
|
19
31
|
BarsPlugin: typeof BarsPluginClass;
|
|
32
|
+
CameraMovePlugin: typeof CameraMove;
|
|
20
33
|
DiagramLinePlugin: typeof DiagramLine;
|
|
34
|
+
TimelinePlugin: typeof TimelinePlugin;
|
|
21
35
|
};
|
|
22
36
|
};
|
|
23
37
|
export default _default;
|
|
24
|
-
export declare const ChartEngine: typeof ChartEngineClass;
|
|
25
|
-
export declare const DataGroupFactory: typeof DataGroupFactoryClass;
|
|
26
|
-
export declare const BarsPlugin: typeof BarsPluginClass;
|
|
27
|
-
export declare const DiagramLinePlugin: typeof DiagramLine;
|