@qfo/qfchart 0.8.1 → 0.8.4
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 +216 -1
- package/dist/qfchart.min.browser.js +20 -19
- package/dist/qfchart.min.es.js +18 -17
- package/package.json +1 -1
- package/src/QFChart.ts +146 -11
- package/src/components/LayoutManager.ts +76 -28
- package/src/components/PluginManager.ts +229 -229
- package/src/components/SeriesBuilder.ts +21 -14
- package/src/components/renderers/LabelRenderer.ts +6 -3
- package/src/components/renderers/ScatterRenderer.ts +92 -54
- package/src/components/renderers/ShapeRenderer.ts +12 -0
- package/src/index.ts +8 -0
- package/src/plugins/CrossLineTool/CrossLineDrawingRenderer.ts +49 -0
- package/src/plugins/CrossLineTool/CrossLineTool.ts +52 -0
- package/src/plugins/CrossLineTool/index.ts +2 -0
- package/src/plugins/ExtendedLineTool/ExtendedLineDrawingRenderer.ts +73 -0
- package/src/plugins/ExtendedLineTool/ExtendedLineTool.ts +173 -0
- package/src/plugins/ExtendedLineTool/index.ts +2 -0
- package/src/plugins/HorizontalLineTool/HorizontalLineDrawingRenderer.ts +54 -0
- package/src/plugins/HorizontalLineTool/HorizontalLineTool.ts +52 -0
- package/src/plugins/HorizontalLineTool/index.ts +2 -0
- package/src/plugins/HorizontalRayTool/HorizontalRayDrawingRenderer.ts +34 -0
- package/src/plugins/HorizontalRayTool/HorizontalRayTool.ts +52 -0
- package/src/plugins/HorizontalRayTool/index.ts +2 -0
- package/src/plugins/InfoLineTool/InfoLineDrawingRenderer.ts +72 -0
- package/src/plugins/InfoLineTool/InfoLineTool.ts +130 -0
- package/src/plugins/InfoLineTool/index.ts +2 -0
- package/src/plugins/LineTool/LineDrawingRenderer.ts +2 -2
- package/src/plugins/LineTool/LineTool.ts +5 -5
- package/src/plugins/RayTool/RayDrawingRenderer.ts +69 -0
- package/src/plugins/RayTool/RayTool.ts +162 -0
- package/src/plugins/RayTool/index.ts +2 -0
- package/src/plugins/TrendAngleTool/TrendAngleDrawingRenderer.ts +87 -0
- package/src/plugins/TrendAngleTool/TrendAngleTool.ts +176 -0
- package/src/plugins/TrendAngleTool/index.ts +2 -0
- package/src/plugins/VerticalLineTool/VerticalLineDrawingRenderer.ts +35 -0
- package/src/plugins/VerticalLineTool/VerticalLineTool.ts +52 -0
- package/src/plugins/VerticalLineTool/index.ts +2 -0
- package/src/types.ts +2 -0
package/dist/index.d.ts
CHANGED
|
@@ -170,6 +170,13 @@ interface DrawingRenderContext {
|
|
|
170
170
|
isSelected: boolean;
|
|
171
171
|
/** The ECharts custom series api object */
|
|
172
172
|
api: any;
|
|
173
|
+
/** Grid coordinate system bounds (x, y, width, height in pixels) */
|
|
174
|
+
coordSys: {
|
|
175
|
+
x: number;
|
|
176
|
+
y: number;
|
|
177
|
+
width: number;
|
|
178
|
+
height: number;
|
|
179
|
+
};
|
|
173
180
|
}
|
|
174
181
|
interface DrawingRenderer {
|
|
175
182
|
/** The drawing type this renderer handles */
|
|
@@ -408,6 +415,16 @@ declare class QFChart implements ChartContext {
|
|
|
408
415
|
removeIndicator(id: string): void;
|
|
409
416
|
toggleIndicator(id: string, action?: 'collapse' | 'maximize' | 'fullscreen'): void;
|
|
410
417
|
resize(): void;
|
|
418
|
+
/**
|
|
419
|
+
* Build invisible "scatter" series that carry the min/max Y values of Pine
|
|
420
|
+
* Script drawing objects (lines, boxes, labels, polylines). ECharts includes
|
|
421
|
+
* these points in its automatic Y-axis range calculation so drawings below
|
|
422
|
+
* or above the candlestick range are no longer clipped.
|
|
423
|
+
*
|
|
424
|
+
* Returns one hidden series per pane that has drawing objects with Y-values
|
|
425
|
+
* outside the default data range.
|
|
426
|
+
*/
|
|
427
|
+
private _buildDrawingRangeHints;
|
|
411
428
|
/**
|
|
412
429
|
* Build table canvas graphic elements from the current _lastTables.
|
|
413
430
|
* Must be called AFTER setOption so grid rects are available from ECharts.
|
|
@@ -572,6 +589,204 @@ declare class LineDrawingRenderer implements DrawingRenderer {
|
|
|
572
589
|
render(ctx: DrawingRenderContext): any;
|
|
573
590
|
}
|
|
574
591
|
|
|
592
|
+
declare class RayTool extends AbstractPlugin {
|
|
593
|
+
private zr;
|
|
594
|
+
private state;
|
|
595
|
+
private startPoint;
|
|
596
|
+
private endPoint;
|
|
597
|
+
private group;
|
|
598
|
+
private line;
|
|
599
|
+
private dashLine;
|
|
600
|
+
private startCircle;
|
|
601
|
+
private endCircle;
|
|
602
|
+
constructor(options?: {
|
|
603
|
+
name?: string;
|
|
604
|
+
icon?: string;
|
|
605
|
+
});
|
|
606
|
+
protected onInit(): void;
|
|
607
|
+
protected onActivate(): void;
|
|
608
|
+
protected onDeactivate(): void;
|
|
609
|
+
protected onDestroy(): void;
|
|
610
|
+
private onClick;
|
|
611
|
+
private onMouseMove;
|
|
612
|
+
private initGraphic;
|
|
613
|
+
private removeGraphic;
|
|
614
|
+
private updateGraphic;
|
|
615
|
+
private extendToEdge;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
declare class RayDrawingRenderer implements DrawingRenderer {
|
|
619
|
+
type: string;
|
|
620
|
+
render(ctx: DrawingRenderContext): any;
|
|
621
|
+
private extendToEdge;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
declare class InfoLineTool extends AbstractPlugin {
|
|
625
|
+
private zr;
|
|
626
|
+
private state;
|
|
627
|
+
private startPoint;
|
|
628
|
+
private endPoint;
|
|
629
|
+
private group;
|
|
630
|
+
private line;
|
|
631
|
+
private startCircle;
|
|
632
|
+
private endCircle;
|
|
633
|
+
constructor(options?: {
|
|
634
|
+
name?: string;
|
|
635
|
+
icon?: string;
|
|
636
|
+
});
|
|
637
|
+
protected onInit(): void;
|
|
638
|
+
protected onActivate(): void;
|
|
639
|
+
protected onDeactivate(): void;
|
|
640
|
+
protected onDestroy(): void;
|
|
641
|
+
private onClick;
|
|
642
|
+
private onMouseMove;
|
|
643
|
+
private initGraphic;
|
|
644
|
+
private removeGraphic;
|
|
645
|
+
private updateGraphic;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
declare class InfoLineDrawingRenderer implements DrawingRenderer {
|
|
649
|
+
type: string;
|
|
650
|
+
render(ctx: DrawingRenderContext): any;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
declare class ExtendedLineTool extends AbstractPlugin {
|
|
654
|
+
private zr;
|
|
655
|
+
private state;
|
|
656
|
+
private startPoint;
|
|
657
|
+
private endPoint;
|
|
658
|
+
private group;
|
|
659
|
+
private line;
|
|
660
|
+
private dashLineForward;
|
|
661
|
+
private dashLineBackward;
|
|
662
|
+
private startCircle;
|
|
663
|
+
private endCircle;
|
|
664
|
+
constructor(options?: {
|
|
665
|
+
name?: string;
|
|
666
|
+
icon?: string;
|
|
667
|
+
});
|
|
668
|
+
protected onInit(): void;
|
|
669
|
+
protected onActivate(): void;
|
|
670
|
+
protected onDeactivate(): void;
|
|
671
|
+
protected onDestroy(): void;
|
|
672
|
+
private onClick;
|
|
673
|
+
private onMouseMove;
|
|
674
|
+
private initGraphic;
|
|
675
|
+
private removeGraphic;
|
|
676
|
+
private updateGraphic;
|
|
677
|
+
private extendToEdge;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
declare class ExtendedLineDrawingRenderer implements DrawingRenderer {
|
|
681
|
+
type: string;
|
|
682
|
+
render(ctx: DrawingRenderContext): any;
|
|
683
|
+
private extendToEdge;
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
declare class TrendAngleTool extends AbstractPlugin {
|
|
687
|
+
private zr;
|
|
688
|
+
private state;
|
|
689
|
+
private startPoint;
|
|
690
|
+
private endPoint;
|
|
691
|
+
private group;
|
|
692
|
+
private line;
|
|
693
|
+
private hRefLine;
|
|
694
|
+
private arc;
|
|
695
|
+
private angleText;
|
|
696
|
+
private startCircle;
|
|
697
|
+
private endCircle;
|
|
698
|
+
constructor(options?: {
|
|
699
|
+
name?: string;
|
|
700
|
+
icon?: string;
|
|
701
|
+
});
|
|
702
|
+
protected onInit(): void;
|
|
703
|
+
protected onActivate(): void;
|
|
704
|
+
protected onDeactivate(): void;
|
|
705
|
+
protected onDestroy(): void;
|
|
706
|
+
private onClick;
|
|
707
|
+
private onMouseMove;
|
|
708
|
+
private initGraphic;
|
|
709
|
+
private removeGraphic;
|
|
710
|
+
private updateGraphic;
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
declare class TrendAngleDrawingRenderer implements DrawingRenderer {
|
|
714
|
+
type: string;
|
|
715
|
+
render(ctx: DrawingRenderContext): any;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
declare class HorizontalLineTool extends AbstractPlugin {
|
|
719
|
+
private zr;
|
|
720
|
+
constructor(options?: {
|
|
721
|
+
name?: string;
|
|
722
|
+
icon?: string;
|
|
723
|
+
});
|
|
724
|
+
protected onInit(): void;
|
|
725
|
+
protected onActivate(): void;
|
|
726
|
+
protected onDeactivate(): void;
|
|
727
|
+
protected onDestroy(): void;
|
|
728
|
+
private onClick;
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
declare class HorizontalLineDrawingRenderer implements DrawingRenderer {
|
|
732
|
+
type: string;
|
|
733
|
+
render(ctx: DrawingRenderContext): any;
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
declare class HorizontalRayTool extends AbstractPlugin {
|
|
737
|
+
private zr;
|
|
738
|
+
constructor(options?: {
|
|
739
|
+
name?: string;
|
|
740
|
+
icon?: string;
|
|
741
|
+
});
|
|
742
|
+
protected onInit(): void;
|
|
743
|
+
protected onActivate(): void;
|
|
744
|
+
protected onDeactivate(): void;
|
|
745
|
+
protected onDestroy(): void;
|
|
746
|
+
private onClick;
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
declare class HorizontalRayDrawingRenderer implements DrawingRenderer {
|
|
750
|
+
type: string;
|
|
751
|
+
render(ctx: DrawingRenderContext): any;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
declare class VerticalLineTool extends AbstractPlugin {
|
|
755
|
+
private zr;
|
|
756
|
+
constructor(options?: {
|
|
757
|
+
name?: string;
|
|
758
|
+
icon?: string;
|
|
759
|
+
});
|
|
760
|
+
protected onInit(): void;
|
|
761
|
+
protected onActivate(): void;
|
|
762
|
+
protected onDeactivate(): void;
|
|
763
|
+
protected onDestroy(): void;
|
|
764
|
+
private onClick;
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
declare class VerticalLineDrawingRenderer implements DrawingRenderer {
|
|
768
|
+
type: string;
|
|
769
|
+
render(ctx: DrawingRenderContext): any;
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
declare class CrossLineTool extends AbstractPlugin {
|
|
773
|
+
private zr;
|
|
774
|
+
constructor(options?: {
|
|
775
|
+
name?: string;
|
|
776
|
+
icon?: string;
|
|
777
|
+
});
|
|
778
|
+
protected onInit(): void;
|
|
779
|
+
protected onActivate(): void;
|
|
780
|
+
protected onDeactivate(): void;
|
|
781
|
+
protected onDestroy(): void;
|
|
782
|
+
private onClick;
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
declare class CrossLineDrawingRenderer implements DrawingRenderer {
|
|
786
|
+
type: string;
|
|
787
|
+
render(ctx: DrawingRenderContext): any;
|
|
788
|
+
}
|
|
789
|
+
|
|
575
790
|
declare class FibonacciTool extends AbstractPlugin {
|
|
576
791
|
private startPoint;
|
|
577
792
|
private endPoint;
|
|
@@ -860,5 +1075,5 @@ declare class DrawingRendererRegistry {
|
|
|
860
1075
|
get(type: string): DrawingRenderer | undefined;
|
|
861
1076
|
}
|
|
862
1077
|
|
|
863
|
-
export { ABCDPatternDrawingRenderer, ABCDPatternTool, AbstractPlugin, CypherPatternDrawingRenderer, CypherPatternTool, DrawingRendererRegistry, FibSpeedResistanceFanDrawingRenderer, FibSpeedResistanceFanTool, FibTrendExtensionDrawingRenderer, FibTrendExtensionTool, FibonacciChannelDrawingRenderer, FibonacciChannelTool, FibonacciDrawingRenderer, FibonacciTool, HeadAndShouldersDrawingRenderer, HeadAndShouldersTool, LineDrawingRenderer, LineTool, MeasureTool, QFChart, ThreeDrivesPatternDrawingRenderer, ThreeDrivesPatternTool, ToolGroup, TrianglePatternDrawingRenderer, TrianglePatternTool, XABCDPatternDrawingRenderer, XABCDPatternTool };
|
|
1078
|
+
export { ABCDPatternDrawingRenderer, ABCDPatternTool, AbstractPlugin, CrossLineDrawingRenderer, CrossLineTool, CypherPatternDrawingRenderer, CypherPatternTool, DrawingRendererRegistry, ExtendedLineDrawingRenderer, ExtendedLineTool, FibSpeedResistanceFanDrawingRenderer, FibSpeedResistanceFanTool, FibTrendExtensionDrawingRenderer, FibTrendExtensionTool, FibonacciChannelDrawingRenderer, FibonacciChannelTool, FibonacciDrawingRenderer, FibonacciTool, HeadAndShouldersDrawingRenderer, HeadAndShouldersTool, HorizontalLineDrawingRenderer, HorizontalLineTool, HorizontalRayDrawingRenderer, HorizontalRayTool, InfoLineDrawingRenderer, InfoLineTool, LineDrawingRenderer, LineTool, MeasureTool, QFChart, RayDrawingRenderer, RayTool, ThreeDrivesPatternDrawingRenderer, ThreeDrivesPatternTool, ToolGroup, TrendAngleDrawingRenderer, TrendAngleTool, TrianglePatternDrawingRenderer, TrianglePatternTool, VerticalLineDrawingRenderer, VerticalLineTool, XABCDPatternDrawingRenderer, XABCDPatternTool };
|
|
864
1079
|
export type { ChartContext, Coordinate, DataCoordinate, DrawingElement, DrawingRenderContext, DrawingRenderer, DrawingType, Indicator$1 as Indicator, IndicatorOptions, IndicatorPlot, IndicatorPoint, IndicatorStyle, OHLCV, Plugin, PluginConfig, QFChartOptions, ToolGroupConfig };
|