@@ -435,26 +435,23 @@ export function validateTemplate(figure: TemplateFigure, template: Template): Va
435435// Layout
436436export interface Layout {
437437 colorway : string [ ] ;
438- title :
439- | string
440- | Partial < {
441- text : string ;
442- font : Partial < Font > ;
443- xref : "container" | "paper" ;
444- yref : "container" | "paper" ;
445- x : number ;
446- y : number ;
447- xanchor : "auto" | "left" | "center" | "right" ;
448- yanchor : "auto" | "top" | "middle" | "bottom" ;
449- pad : Partial < Padding > ;
450- subtitle :
451- | string
452- | Partial < {
453- text : string ;
454- font : Partial < Font > ;
455- } > ;
456- } > ;
457- titlefont : Partial < Font > ;
438+ title : Partial < {
439+ text : string ;
440+ font : Partial < Font > ;
441+ xref : "container" | "paper" ;
442+ yref : "container" | "paper" ;
443+ x : number ;
444+ y : number ;
445+ xanchor : "auto" | "left" | "center" | "right" ;
446+ yanchor : "auto" | "top" | "middle" | "bottom" ;
447+ pad : Partial < Padding > ;
448+ subtitle :
449+ | string
450+ | Partial < {
451+ text : string ;
452+ font : Partial < Font > ;
453+ } > ;
454+ } > ;
458455 autosize : boolean ;
459456 showlegend : boolean ;
460457 paper_bgcolor : Color ;
@@ -486,6 +483,12 @@ export interface Layout {
486483 hoverdistance : number ;
487484 hoverlabel : Partial < HoverLabel > ;
488485 calendar : Calendar ;
486+
487+ // these are just the most common nested property updates that you might
488+ // want to pass to Plotly.relayout - *any* dotted property path through the
489+ // normal nested structure is valid here, and enumerating them all including
490+ // all possible [n] array indices would be infeasible (if it weren't for the
491+ // array indices, the pure a.b.c bit might be doable with conditional types)
489492 "xaxis.range" : [ Datum , Datum ] ;
490493 "xaxis.range[0]" : Datum ;
491494 "xaxis.range[1]" : Datum ;
@@ -496,8 +499,8 @@ export interface Layout {
496499 "xaxis.type" : AxisType ;
497500 "xaxis.autorange" : boolean ;
498501 "yaxis.autorange" : boolean ;
499- "xaxis.title" : string ;
500- "yaxis.title" : string ;
502+ "xaxis.title" : Partial < DataTitle > ;
503+ "yaxis.title" : Partial < DataTitle > ;
501504 ternary : { } ; // TODO
502505 geo : { } ; // TODO
503506 mapbox : Partial < Mapbox > ;
@@ -690,12 +693,7 @@ export interface Axis {
690693 * Individual pieces can override this.
691694 */
692695 color : Color ;
693- title : string | Partial < DataTitle > ;
694- /**
695- * Former `titlefont` is now the sub-attribute `font` of `title`.
696- * To customize title font properties, please use `title.font` now.
697- */
698- titlefont : Partial < Font > ;
696+ title : Partial < DataTitle > ;
699697 type : AxisType ;
700698 autorange : true | false | "reversed" | "min reversed" | "max reversed" | "min" | "max" ;
701699 autorangeoptions : Partial < AutoRangeOptions > ;
@@ -967,7 +965,6 @@ export interface LayoutAxis extends Axis {
967965 rangeslider : Partial < RangeSlider > ;
968966 rangeselector : Partial < RangeSelector > ;
969967 automargin : boolean ;
970- autotick : boolean ;
971968 angle : any ;
972969 griddash : Dash ;
973970 l2p : ( v : Datum ) => number ;
@@ -1260,7 +1257,6 @@ export interface ErrorOptions {
12601257 color : Color ;
12611258 thickness : number ;
12621259 width : number ;
1263- opacity : number ;
12641260}
12651261
12661262export type ErrorBar =
@@ -1294,7 +1290,6 @@ export type PlotType =
12941290 | "funnel"
12951291 | "funnelarea"
12961292 | "heatmap"
1297- | "heatmapgl"
12981293 | "histogram"
12991294 | "histogram2d"
13001295 | "histogram2dcontour"
@@ -1306,7 +1301,6 @@ export type PlotType =
13061301 | "parcats"
13071302 | "parcoords"
13081303 | "pie"
1309- | "pointcloud"
13101304 | "sankey"
13111305 | "scatter"
13121306 | "scatter3d"
@@ -1342,7 +1336,6 @@ export type Color =
13421336 | Array < string | number | undefined | null >
13431337 | Array < Array < string | number | undefined | null > > ;
13441338export type ColorScale = string | string [ ] | Array < [ number , string ] > ;
1345- export type DataTransform = Partial < Transform > ;
13461339export type ScatterData = PlotData ;
13471340
13481341export interface PlotData {
@@ -1506,7 +1499,6 @@ export interface PlotData {
15061499 delta : Partial < Delta > ;
15071500 gauge : Partial < Gauge > ;
15081501 number : Partial < PlotNumber > ;
1509- transforms : DataTransform [ ] ;
15101502 orientation : "v" | "h" ;
15111503 width : number | number [ ] ;
15121504 boxmean : boolean | "sd" ;
@@ -1575,46 +1567,10 @@ export interface PlotData {
15751567 uid : string ;
15761568}
15771569
1578- /**
1579- * These interfaces are based on attribute descriptions in
1580- * https://github.com/plotly/plotly.js/tree/9d6144304308fc3007f0facf2535d38ea3e9b26c/src/transforms
1581- */
1582- export interface TransformStyle {
1583- target : number | string | number [ ] | string [ ] ;
1584- value : Partial < PlotData > ;
1585- }
1586-
1587- export interface TransformAggregation {
1588- target : string ;
1589- func ?:
1590- | "count"
1591- | "sum"
1592- | "avg"
1593- | "median"
1594- | "mode"
1595- | "rms"
1596- | "stddev"
1597- | "min"
1598- | "max"
1599- | "first"
1600- | "last"
1601- | undefined ;
1602- funcmode ?: "sample" | "population" | undefined ;
1603- enabled ?: boolean | undefined ;
1604- }
1605-
1606- export interface Transform {
1607- type : "aggregate" | "filter" | "groupby" | "sort" ;
1608- enabled : boolean ;
1609- target : number | string | number [ ] | string [ ] ;
1610- operation : string ;
1611- aggregations : TransformAggregation [ ] ;
1612- preservegaps : boolean ;
1613- groups : string | number [ ] | string [ ] ;
1614- nameformat : string ;
1615- styles : TransformStyle [ ] ;
1616- value : any ;
1617- order : "ascending" | "descending" ;
1570+ export interface ColorBarTitle {
1571+ text : string ;
1572+ font : Partial < Font > ;
1573+ side : "right" | "top" | "bottom" ;
16181574}
16191575
16201576export interface ColorBar {
@@ -1656,9 +1612,7 @@ export interface ColorBar {
16561612 exponentformat : "none" | "e" | "E" | "power" | "SI" | "B" ;
16571613 showexponent : "all" | "first" | "last" | "none" ;
16581614 minexponent : number ;
1659- title : string ;
1660- titlefont : Font ;
1661- titleside : "right" | "top" | "bottom" ;
1615+ title : Partial < ColorBarTitle > ;
16621616 tickvalssrc : any ;
16631617 ticktextsrc : any ;
16641618}
@@ -1908,9 +1862,6 @@ export interface Config {
19081862 */
19091863 logging : boolean | 0 | 1 | 2 ;
19101864
1911- /** Set global transform to be applied to all traces with no specification needed */
1912- globalTransforms : any [ ] ;
1913-
19141865 /** Which localization should we use? Should be a string like 'en' or 'en-US' */
19151866 locale : string ;
19161867
@@ -2774,15 +2725,6 @@ interface LocaleModule {
27742725 format : Record < string , unknown > ;
27752726}
27762727
2777- interface TransformModule {
2778- moduleType : "transform" ;
2779- name : string ;
2780- transform : any ;
2781- calcTransform : any ;
2782- attributes : Record < string , unknown > ;
2783- supplyDefaults : any ;
2784- }
2785-
27862728interface ComponentModule {
27872729 moduleType : "component" ;
27882730 name : string ;
@@ -2794,4 +2736,4 @@ interface ApiMethodModule {
27942736 fn : any ;
27952737}
27962738
2797- type PlotlyModule = TraceModule | LocaleModule | TransformModule | ComponentModule | ApiMethodModule ;
2739+ type PlotlyModule = TraceModule | LocaleModule | ComponentModule | ApiMethodModule ;
0 commit comments