Skip to content

Commit 813ab71

Browse files
committed
Update schema and types
1 parent 5d3e198 commit 813ab71

3 files changed

Lines changed: 216 additions & 201 deletions

File tree

src/types/core/data.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import type {
4141
ParcoordsData,
4242
PieData,
4343
PlotType,
44+
QuiverData,
4445
SankeyData,
4546
Scatter3dData,
4647
ScattercarpetData,
@@ -101,6 +102,7 @@ export type Data =
101102
| Partial<ParcatsData>
102103
| Partial<ParcoordsData>
103104
| Partial<PieData>
105+
| Partial<QuiverData>
104106
| Partial<SankeyData>
105107
| Partial<Scatter3dData>
106108
| Partial<ScattercarpetData>

src/types/generated/schema.d.ts

Lines changed: 208 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export type PatternShape = '' | '/' | '\\' | 'x' | '-' | '|' | '+' | '.';
2323

2424
export type TransitionEasing = 'linear' | 'quad' | 'cubic' | 'sin' | 'exp' | 'circle' | 'elastic' | 'back' | 'bounce' | 'linear-in' | 'quad-in' | 'cubic-in' | 'sin-in' | 'exp-in' | 'circle-in' | 'elastic-in' | 'back-in' | 'bounce-in' | 'linear-out' | 'quad-out' | 'cubic-out' | 'sin-out' | 'exp-out' | 'circle-out' | 'elastic-out' | 'back-out' | 'bounce-out' | 'linear-in-out' | 'quad-in-out' | 'cubic-in-out' | 'sin-in-out' | 'exp-in-out' | 'circle-in-out' | 'elastic-in-out' | 'back-in-out' | 'bounce-in-out';
2525

26-
export type TraceType = 'bar' | 'barpolar' | 'box' | 'candlestick' | 'carpet' | 'choropleth' | 'choroplethmap' | 'choroplethmapbox' | 'cone' | 'contour' | 'contourcarpet' | 'densitymap' | 'densitymapbox' | 'funnel' | 'funnelarea' | 'heatmap' | 'histogram' | 'histogram2d' | 'histogram2dcontour' | 'icicle' | 'image' | 'indicator' | 'isosurface' | 'mesh3d' | 'ohlc' | 'parcats' | 'parcoords' | 'pie' | 'sankey' | 'scatter' | 'scatter3d' | 'scattercarpet' | 'scattergeo' | 'scattergl' | 'scattermap' | 'scattermapbox' | 'scatterpolar' | 'scatterpolargl' | 'scattersmith' | 'scatterternary' | 'splom' | 'streamtube' | 'sunburst' | 'surface' | 'table' | 'treemap' | 'violin' | 'volume' | 'waterfall';
26+
export type TraceType = 'bar' | 'barpolar' | 'box' | 'candlestick' | 'carpet' | 'choropleth' | 'choroplethmap' | 'choroplethmapbox' | 'cone' | 'contour' | 'contourcarpet' | 'densitymap' | 'densitymapbox' | 'funnel' | 'funnelarea' | 'heatmap' | 'histogram' | 'histogram2d' | 'histogram2dcontour' | 'icicle' | 'image' | 'indicator' | 'isosurface' | 'mesh3d' | 'ohlc' | 'parcats' | 'parcoords' | 'pie' | 'quiver' | 'sankey' | 'scatter' | 'scatter3d' | 'scattercarpet' | 'scattergeo' | 'scattergl' | 'scattermap' | 'scattermapbox' | 'scatterpolar' | 'scatterpolargl' | 'scattersmith' | 'scatterternary' | 'splom' | 'streamtube' | 'sunburst' | 'surface' | 'table' | 'treemap' | 'violin' | 'volume' | 'waterfall';
2727

2828
/** @deprecated Renamed to TraceType. */
2929
export type PlotType = TraceType;
@@ -6959,6 +6959,213 @@ export interface PieData {
69596959
visible?: true | false | 'legendonly';
69606960
}
69616961

6962+
export interface QuiverData {
6963+
/**
6964+
* Sets the arrows' anchor with respect to their (x,y) positions. Use *tail* to place (x,y) at the base, *tip* to place (x,y) at the head, or *center* to center the arrow on (x,y).
6965+
* @default 'tail'
6966+
*/
6967+
anchor?: 'tip' | 'tail' | 'center';
6968+
/** Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, *scatter* traces also appends customdata items in the markers DOM elements */
6969+
customdata?: Datum[] | Datum[][] | TypedArray;
6970+
/**
6971+
* Sets the x coordinate step. See `x0` for more info.
6972+
* @default 1
6973+
*/
6974+
dx?: number;
6975+
/**
6976+
* Sets the y coordinate step. See `y0` for more info.
6977+
* @default 1
6978+
*/
6979+
dy?: number;
6980+
/**
6981+
* Maximum distance (in pixels) to look for nearby arrows on hover.
6982+
* @default 20
6983+
* Minimum: -1
6984+
*/
6985+
hoverdistance?: number;
6986+
/**
6987+
* Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired.
6988+
* @default 'all'
6989+
*/
6990+
hoverinfo?: 'x' | 'y' | 'u' | 'v' | 'text' | 'name' | 'all' | 'none' | 'skip' | (string & {}) | ('x' | 'y' | 'u' | 'v' | 'text' | 'name' | 'all' | 'none' | 'skip' | (string & {}))[];
6991+
hoverlabel?: HoverLabel;
6992+
/** Template string used for rendering the information that appear on hover box. Note that this will override `hoverinfo`. Variables are inserted using %{variable}, for example "y: %{y}" as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, *xother* will be added to those with different x positions from the first point. An underscore before or after *(x|y)other* will add a space on that side, only when this field is shown. Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. Variables that can't be found will be replaced with the specifier. For example, a template of "data: %{x}, %{y}" will result in a value of "data: 1, %{y}" if x is 1 and y is missing. Variables with an undefined value will be replaced with the fallback value. The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, all attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. Finally, the template string has access to variables `x`, `y`, `u`, `v`, `text` and `name`. Anything contained in tag `<extra>` is displayed in the secondary box, for example `<extra>%{fullData.name}</extra>`. To hide the secondary box completely, use an empty tag `<extra></extra>`. */
6993+
hovertemplate?: string | string[];
6994+
/** Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type. */
6995+
ids?: Datum[] | Datum[][] | TypedArray;
6996+
/**
6997+
* Sets the reference to a legend to show this trace in. References to these legends are *legend*, *legend2*, *legend3*, etc. Settings for these legends are set in the layout, under `layout.legend`, `layout.legend2`, etc.
6998+
* @default 'legend'
6999+
*/
7000+
legend?: string;
7001+
/** Sets the legend group for this trace. Traces and shapes part of the same legend group hide/show at the same time when toggling legend items. */
7002+
legendgroup?: string;
7003+
legendgrouptitle?: LegendGroupTitle;
7004+
/**
7005+
* Sets the legend rank for this trace. Items and groups with smaller ranks are presented on top/left side while with *reversed* `legend.traceorder` they are on bottom/right side. The default legendrank is 1000, so that you can use ranks less than 1000 to place certain items before all unranked items, and ranks greater than 1000 to go after all unranked items. When having unranked or equal rank items shapes would be displayed after traces i.e. according to their order in data and layout.
7006+
* @default 1000
7007+
*/
7008+
legendrank?: number;
7009+
/**
7010+
* Sets the width (in px or fraction) of the legend for this trace.
7011+
* Minimum: 0
7012+
*/
7013+
legendwidth?: number;
7014+
marker?: {
7015+
/**
7016+
* Sets the size of the arrow head relative to `marker.line.width`. A value of 1 (default) gives a head about 3x as wide as the line.
7017+
* @default 1
7018+
* Minimum: 0.3
7019+
*/
7020+
arrowsize?: number;
7021+
/**
7022+
* Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `marker.colorscale`. Has an effect only if in `marker.color` is set to a numerical array. In case `colorscale` is unspecified or `autocolorscale` is true, the default palette will be chosen according to whether numbers in the `color` array are all positive, all negative or mixed.
7023+
* @default true
7024+
*/
7025+
autocolorscale?: boolean;
7026+
/**
7027+
* Determines whether or not the color domain is computed with respect to the input data (here in `marker.color`) or the bounds set in `marker.cmin` and `marker.cmax` Has an effect only if in `marker.color` is set to a numerical array. Defaults to `false` when `marker.cmin` and `marker.cmax` are set by the user.
7028+
* @default true
7029+
*/
7030+
cauto?: boolean;
7031+
/**
7032+
* Sets the upper bound of the color domain. Has an effect only if in `marker.color` is set to a numerical array. Value should have the same units as in `marker.color` and if set, `marker.cmin` must be set as well.
7033+
* Setting this also sets: cauto = false
7034+
*/
7035+
cmax?: number;
7036+
/** Sets the mid-point of the color domain by scaling `marker.cmin` and/or `marker.cmax` to be equidistant to this point. Has an effect only if in `marker.color` is set to a numerical array. Value should have the same units as in `marker.color`. Has no effect when `marker.cauto` is `false`. */
7037+
cmid?: number;
7038+
/**
7039+
* Sets the lower bound of the color domain. Has an effect only if in `marker.color` is set to a numerical array. Value should have the same units as in `marker.color` and if set, `marker.cmax` must be set as well.
7040+
* Setting this also sets: cauto = false
7041+
*/
7042+
cmin?: number;
7043+
/** Sets the marker color. It accepts either a specific color or an array of numbers that are mapped to the colorscale relative to the max and min values of the array or relative to `marker.cmin` and `marker.cmax` if set. */
7044+
color?: Color | Color[];
7045+
/** Sets a reference to a shared color axis. References to these shared color axes are *coloraxis*, *coloraxis2*, *coloraxis3*, etc. Settings for these shared color axes are set in the layout, under `layout.coloraxis`, `layout.coloraxis2`, etc. Note that multiple color scales can be linked to the same color axis. */
7046+
coloraxis?: string;
7047+
colorbar?: ColorBar;
7048+
/**
7049+
* Sets the colorscale. Has an effect only if in `marker.color` is set to a numerical array. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsla, hwb, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in color space, use `marker.cmin` and `marker.cmax`. Alternatively, `colorscale` may be a palette name string of the following list: Blackbody,Bluered,Blues,Cividis,Earth,Electric,Greens,Greys,Hot,Jet,Picnic,Portland,Rainbow,RdBu,Reds,Viridis,YlGnBu,YlOrRd.
7050+
* Setting this also sets: autocolorscale = false
7051+
*/
7052+
colorscale?: ColorScale;
7053+
line?: {
7054+
/**
7055+
* Sets the dash style of lines. Set to a dash type string (*solid*, *dot*, *dash*, *longdash*, *dashdot*, or *longdashdot*) or a dash length list in px (eg *5px,10px,2px,2px*).
7056+
* @default 'solid'
7057+
*/
7058+
dash?: Dash;
7059+
/**
7060+
* Sets the width (in px) of the arrow lines.
7061+
* @default 1
7062+
* Minimum: 0
7063+
*/
7064+
width?: number;
7065+
};
7066+
/**
7067+
* Reverses the color mapping if true. Has an effect only if in `marker.color` is set to a numerical array. If true, `marker.cmin` will correspond to the last color in the array and `marker.cmax` will correspond to the first color.
7068+
* @default false
7069+
*/
7070+
reversescale?: boolean;
7071+
/**
7072+
* Determines whether or not a colorbar is displayed for this trace. Has an effect only if in `marker.color` is set to a numerical array.
7073+
* @default true
7074+
*/
7075+
showscale?: boolean;
7076+
};
7077+
/** Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace `name`, graph, axis and colorbar `title.text`, annotation `text` `rangeselector`, `updatemenues` and `sliders` `label` text all support `meta`. To access the trace `meta` values in an attribute in the same trace, simply use `%{meta[i]}` where `i` is the index or key of the `meta` item in question. To access trace `meta` in layout attributes, use `%{data[n[.meta[i]}` where `i` is the index or key of the `meta` and `n` is the trace index. */
7078+
meta?: any;
7079+
/** Sets the trace name. The trace name appears as the legend item and on hover. */
7080+
name?: string;
7081+
/**
7082+
* Sets the opacity of the trace.
7083+
* @default 1
7084+
* Range: [0, 1]
7085+
*/
7086+
opacity?: number;
7087+
selected?: {
7088+
line?: _internal.ErrorY;
7089+
textfont?: Font;
7090+
};
7091+
/** Array containing integer indices of selected points. Has an effect only for traces that support selections. Note that an empty array means an empty selection where the `unselected` are turned on for all points, whereas, any other non-array values means no selection all where the `selected` and `unselected` styles have no effect. */
7092+
selectedpoints?: any;
7093+
/**
7094+
* Determines whether or not an item corresponding to this trace is shown in the legend.
7095+
* @default true
7096+
*/
7097+
showlegend?: boolean;
7098+
/**
7099+
* Determines whether `sizeref` is set as a *scaled* (unitless) scalar (normalized by the max u/v norm in the vector field), as an *absolute* value (in the same units as the vector field), or *raw* to use the raw vector lengths.
7100+
* @default 'scaled'
7101+
*/
7102+
sizemode?: 'scaled' | 'absolute' | 'raw';
7103+
/**
7104+
* Adjusts the arrow size scaling. The arrow length is determined by the vector norm multiplied by `sizeref`, optionally normalized when `sizemode` is *scaled*.
7105+
* Minimum: 0
7106+
*/
7107+
sizeref?: number;
7108+
/** Sets text elements associated with each (x,y) pair. */
7109+
text?: Datum[] | Datum[][] | TypedArray;
7110+
/** Sets the text font. */
7111+
textfont?: FontArray;
7112+
/**
7113+
* Sets the positions of the `text` elements with respects to the (x,y) coordinates.
7114+
* @default 'middle center'
7115+
*/
7116+
textposition?: 'top left' | 'top center' | 'top right' | 'middle left' | 'middle center' | 'middle right' | 'bottom left' | 'bottom center' | 'bottom right';
7117+
type?: 'quiver';
7118+
/** Sets the x components of the arrow vectors. */
7119+
u?: Datum[] | Datum[][] | TypedArray;
7120+
/** Sets the hover text formatting rule for `u` using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/tree/v1.4.5#d3-format.By default the values are formatted using generic number format. */
7121+
uhoverformat?: string;
7122+
/** Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions. */
7123+
uid?: string;
7124+
/** Controls persistence of some user-driven changes to the trace: `constraintrange` in `parcoords` traces, as well as some `editable: true` modifications such as `name` and `colorbar.title`. Defaults to `layout.uirevision`. Note that other user-driven trace attribute changes are controlled by `layout` attributes: `trace.visible` is controlled by `layout.legend.uirevision`, `selectedpoints` is controlled by `layout.selectionrevision`, and `colorbar.(x|y)` (accessible with `config: {editable: true}`) is controlled by `layout.editrevision`. Trace changes are tracked by `uid`, which only falls back on trace index if no `uid` is provided. So if your app can add/remove traces before the end of the `data` array, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace a `uid` that stays with it as it moves. */
7125+
uirevision?: any;
7126+
unselected?: {
7127+
line?: _internal.ErrorY;
7128+
textfont?: Font;
7129+
};
7130+
/** Sets the y components of the arrow vectors. */
7131+
v?: Datum[] | Datum[][] | TypedArray;
7132+
/** Sets the hover text formatting rule for `v` using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/tree/v1.4.5#d3-format.By default the values are formatted using generic number format. */
7133+
vhoverformat?: string;
7134+
/**
7135+
* Determines whether or not this trace is visible. If *legendonly*, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).
7136+
* @default true
7137+
*/
7138+
visible?: true | false | 'legendonly';
7139+
/** Sets the x coordinates of the arrow locations. */
7140+
x?: Datum[] | Datum[][] | TypedArray;
7141+
/**
7142+
* Alternate to `x`. Builds a linear space of x coordinates. Use with `dx` where `x0` is the starting coordinate and `dx` the step.
7143+
* @default 0
7144+
*/
7145+
x0?: any;
7146+
/**
7147+
* Sets a reference between this trace's x coordinates and a 2D cartesian x axis. If *x* (the default value), the x coordinates refer to `layout.xaxis`. If *x2*, the x coordinates refer to `layout.xaxis2`, and so on.
7148+
* @default 'x'
7149+
*/
7150+
xaxis?: string;
7151+
/** Sets the hover text formatting rule for `x` using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/tree/v1.4.5#d3-format. And for dates see: https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format. We add two items to d3's date formatter: *%h* for half of the year as a decimal number as well as *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*By default the values are formatted using `xaxis.hoverformat`. */
7152+
xhoverformat?: string;
7153+
/** Sets the y coordinates of the arrow locations. */
7154+
y?: Datum[] | Datum[][] | TypedArray;
7155+
/**
7156+
* Alternate to `y`. Builds a linear space of y coordinates. Use with `dy` where `y0` is the starting coordinate and `dy` the step.
7157+
* @default 0
7158+
*/
7159+
y0?: any;
7160+
/**
7161+
* Sets a reference between this trace's y coordinates and a 2D cartesian y axis. If *y* (the default value), the y coordinates refer to `layout.yaxis`. If *y2*, the y coordinates refer to `layout.yaxis2`, and so on.
7162+
* @default 'y'
7163+
*/
7164+
yaxis?: string;
7165+
/** Sets the hover text formatting rule for `y` using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/tree/v1.4.5#d3-format. And for dates see: https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format. We add two items to d3's date formatter: *%h* for half of the year as a decimal number as well as *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*By default the values are formatted using `yaxis.hoverformat`. */
7166+
yhoverformat?: string;
7167+
}
7168+
69627169
export interface SankeyData {
69637170
/**
69647171
* If value is `snap` (the default), the node arrangement is assisted by automatic snapping of elements to preserve space between nodes specified via `nodepad`. If value is `perpendicular`, the nodes can only move along a line perpendicular to the flow. If value is `freeform`, the nodes can freely move on the plane. If value is `fixed`, the nodes are stationary.

0 commit comments

Comments
 (0)