Browse Source

upd dist

merge-requests/1/merge
vargburz 3 years ago
parent
commit
c583c67075
  1. 29
      dist/index.d.ts
  2. 2
      dist/index.js
  3. 7
      dist/types.d.ts

29
dist/index.d.ts vendored

@ -1,6 +1,11 @@
import { GaugeTimeSerie, GaugeOptions, Stat } from './types'; import { GaugeTimeSerie, GaugeOptions, Stat, PointCoordinate } from './types';
import { ChartwerkPod } from '@chartwerk/core'; import { ChartwerkPod } from '@chartwerk/core';
import * as d3 from 'd3';
export declare class ChartwerkGaugePod extends ChartwerkPod<GaugeTimeSerie, GaugeOptions> { export declare class ChartwerkGaugePod extends ChartwerkPod<GaugeTimeSerie, GaugeOptions> {
_draggableLines: any[];
_draggedThresholdValues: number[];
_thresholdArc: any | null;
_thresholdTextLabels: any[];
constructor(el: HTMLElement, _series?: GaugeTimeSerie[], _options?: GaugeOptions); constructor(el: HTMLElement, _series?: GaugeTimeSerie[], _options?: GaugeOptions);
renderMetrics(): void; renderMetrics(): void;
protected updateOptions(newOptions: GaugeOptions): void; protected updateOptions(newOptions: GaugeOptions): void;
@ -19,13 +24,31 @@ export declare class ChartwerkGaugePod extends ChartwerkPod<GaugeTimeSerie, Gaug
private _renderValue; private _renderValue;
private _renderValueArc; private _renderValueArc;
private _renderThresholdArc; private _renderThresholdArc;
protected _getThresholdArc(): d3.Arc<any, d3.DefaultArcObject>;
get arcScale(): d3.ScaleLinear<number, number>;
protected _renderDraggableLines(): void;
protected _renderDraggableLine(stopValue: number, idx: number): void;
onDrag(idx: number): void;
updateThresholdArcByNewValues(stops: number[]): void;
updateThresholdLabel(value: number, idx: number): void;
updateDraggableLineByAngle(angle: number, idx: number): void;
onDragEnd(idx: number): void;
getAngleFromCoordinates(x: number, y: number): number;
getAngleBetween2Vectors(vector1: {
start: PointCoordinate;
end: PointCoordinate;
}, vector2: {
start: PointCoordinate;
end: PointCoordinate;
}): number;
restrictAngle(angle: number, idx: number): number;
protected _renderLabels(): void; protected _renderLabels(): void;
protected renderLabelBackground(x: number, y: number): void; protected renderLabelBackground(x: number, y: number): void;
protected renderLabelText(x: number, y: number, text: string): void; protected renderLabelText(x: number, y: number, text: string): d3.Selection<SVGTextElement, unknown, null, undefined>;
private get _d3Pie(); private get _d3Pie();
private get _valueArcColors(); private get _valueArcColors();
private get _mainCircleColor(); private get _mainCircleColor();
private get _stopsRange(); private _getStopsRange;
getUpdatedRangeWithMinValue(range: number[]): number[]; getUpdatedRangeWithMinValue(range: number[]): number[];
private get _valueRange(); private get _valueRange();
private get _sortedStops(); private get _sortedStops();

2
dist/index.js vendored

File diff suppressed because one or more lines are too long

7
dist/types.d.ts vendored

@ -9,6 +9,10 @@ export declare type Stop = {
color: string; color: string;
value: number | null; value: number | null;
}; };
export declare type PointCoordinate = {
x: number;
y: number;
};
export declare type ValueFormatter = (value: number) => string; export declare type ValueFormatter = (value: number) => string;
export declare type GaugeTimeSerie = TimeSerie; export declare type GaugeTimeSerie = TimeSerie;
export declare type IconConfig = { export declare type IconConfig = {
@ -39,5 +43,8 @@ export declare type GaugeOptionsParams = {
reversed: boolean; reversed: boolean;
enableThresholdLabels: boolean; enableThresholdLabels: boolean;
enableExtremumLabels: boolean; enableExtremumLabels: boolean;
enableThresholdDrag: boolean;
dragCallback: (event: any) => void;
dragEndCallback: (event: any) => void;
}; };
export declare type GaugeOptions = Options & Partial<GaugeOptionsParams>; export declare type GaugeOptions = Options & Partial<GaugeOptionsParams>;

Loading…
Cancel
Save