11import type {
2- FunctionOptions ,
3- PlotOptions ,
2+ FunctionInputs ,
3+ PlotInputs ,
44 PluginSettings ,
55 rendererType ,
66} from "./types" ;
@@ -25,65 +25,50 @@ export const DEFAULT_PLUGIN_SETTINGS: PluginSettings = {
2525 defaultRenderer : "interactive" ,
2626} ;
2727
28- export const FALLBACK_FUNCTION_OPTIONS : Partial < FunctionOptions > = {
29- range : {
30- min : - Infinity ,
31- max : Infinity ,
32- } ,
28+ /**
29+ * The options displayed for renderers
30+ */
31+ // eslint-disable-next-line no-unused-vars
32+ export const rendererOptions : { [ _ in rendererType ] : string } = {
33+ interactive : "Interactive (zoomable)" ,
34+ image : "Image (exportable)" ,
3335} ;
3436
35- export const DEFAULT_FUNCTION_INPUTS : FunctionOptions = {
37+ export const DEFAULT_FUNCTION_INPUTS : FunctionInputs = {
3638 id : null ,
37- fnType : "linear" , // always set by the plugin
38- fn : "" , // error if missing, no fallback
39+ fnType : undefined , // always set by the plugin
40+ fn : undefined , // error if missing, no fallback
3941 vector : {
40- x : null ,
41- y : null ,
42+ x : undefined ,
43+ y : undefined ,
4244 } , // error if missing, no fallback
43- r : "" , // error if missing, no fallback
44- color : "#808080" ,
45+ r : undefined , // error if missing, no fallback
46+ color : null , // set by color generator. fallback value is gray
4547 offset : {
46- x : null ,
47- y : null ,
48+ x : undefined ,
49+ y : undefined ,
4850 } ,
4951 closed : false ,
50- graphType : null ,
52+ graphType : undefined ,
5153 range : {
52- min : null ,
53- max : null ,
54+ min : undefined ,
55+ max : undefined ,
5456 } ,
55- nSamples : null ,
57+ nSamples : undefined ,
5658 skipTip : false ,
5759} ;
5860
59- /**
60- * The options displayed for renderers
61- */
62- // eslint-disable-next-line no-unused-vars
63- export const rendererOptions : { [ _ in rendererType ] : string } = {
64- interactive : "Interactive (zoomable)" ,
65- image : "Image (exportable)" ,
66- } ;
67-
68- export const FALLBACK_PLOT_OPTIONS : Partial < PlotOptions > = {
69- xAxis : {
70- domain : {
71- min : - 10 ,
72- max : 10 ,
73- } ,
74- } ,
75- yAxis : {
76- domain : {
77- min : - 10 ,
78- max : 10 ,
79- } ,
61+ export const FALLBACK_FUNCTION_INPUTS : Partial < FunctionInputs > = {
62+ range : {
63+ min : - Infinity ,
64+ max : Infinity ,
8065 } ,
8166} ;
8267
8368/**
8469 * The default options for a plot.
8570 */
86- export const DEFAULT_PLOT_INPUTS : PlotOptions = {
71+ export const DEFAULT_PLOT_INPUTS : PlotInputs = {
8772 target : null , // set by rendering function
8873 renderer : null , // has initial state controlled by plugin.settings.defaultRenderer
8974 title : null ,
@@ -102,3 +87,18 @@ export const DEFAULT_PLOT_INPUTS: PlotOptions = {
10287 disableZoom : false ,
10388 data : [ ] ,
10489} ;
90+
91+ export const FALLBACK_PLOT_INPUTS : Partial < PlotInputs > = {
92+ xAxis : {
93+ domain : {
94+ min : - 10 ,
95+ max : 10 ,
96+ } ,
97+ } ,
98+ yAxis : {
99+ domain : {
100+ min : - 10 ,
101+ max : 10 ,
102+ } ,
103+ } ,
104+ } ;
0 commit comments