This repository was archived by the owner on Mar 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDualAxisScatterplot.d.ts
More file actions
79 lines (79 loc) · 2.48 KB
/
Copy pathDualAxisScatterplot.d.ts
File metadata and controls
79 lines (79 loc) · 2.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/**
* author: Samuel Gratzl
* email: samuel_gratzl@gmx.at
* created: 2016-10-28T11:19:52.797Z
*/
import { ISymbol } from './symbol';
import { AScatterplot, IScale, IFormatOptions, IScatterplotOptions, IScalesObject, IAccessor, ERenderReason, INormalizedScalesObject } from './AScatterplot';
export interface IDualAxisScalesObject extends IScalesObject {
y2: IScale;
}
export interface IDualAxisNormalizedScalesObject extends INormalizedScalesObject {
n2pY2: IScale;
}
export interface IDualAxisFormatOptions extends IFormatOptions {
/**
* d3 format used for formatting the y2 axis
*/
y2: string | ((n: number) => string) | null;
}
/**
* scatterplot options
*/
export interface IDualAxisScatterplotOptions<T, U> extends IScatterplotOptions<T> {
/**
* x2 accessor of the secondary data
* default: d.x
* @param d
*/
x2: IAccessor<U>;
/**
* y2 accessor of the secondary data
* default: d.y
* @param d
*/
y2: IAccessor<U>;
/**
* y axis label
* default: x
*/
y2label: string;
/**
* d3 y2 scale
* default: linear scale with a domain from 0...100
*/
y2scale: IScale;
/**
* instead of specifying the scale just the y limits
*/
y2lim: [number, number];
/**
* renderer used to render secondary dataset
* default: steelblue circle
*/
symbol2: ISymbol<U> | string;
format: IDualAxisFormatOptions;
}
/**
* a class for rendering a double y-axis scatterplot in a canvas
*/
export declare class DualAxisScatterplot<T, U> extends AScatterplot<T, IDualAxisScatterplotOptions<T, U>> {
protected readonly normalized2pixel: IDualAxisScalesObject;
private secondaryTree;
private readonly renderer;
private readonly secondaryRenderer;
constructor(data: T[], secondaryData: U[], root: HTMLElement, props?: Partial<IDualAxisScatterplotOptions<T, U>>);
private setSecondaryData;
set secondaryData(secondaryData: U[]);
transformedScales(): IDualAxisScalesObject;
protected transformedNormalized2PixelScales(): IDualAxisNormalizedScalesObject;
render(reason?: ERenderReason, transformDelta?: {
x: number;
y: number;
kx: number;
ky: number;
}): void;
protected renderAxes(xscale: IScale, yscale: IScale, y2scale: IScale): void;
private renderTree;
static dualAxis<T, U>(data: T[], secondaryData: U[], canvas: HTMLCanvasElement, options: IDualAxisScatterplotOptions<T, U>): DualAxisScatterplot<T, U>;
}