Skip to content

Commit 7feecad

Browse files
🤖 Merge PR DefinitelyTyped#73931 [dygraphs] Add missing fields in config and annotation types by @rolflifvergren-smhi
1 parent aa31443 commit 7feecad

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

‎types/dygraphs/dygraphs-tests.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ const d = new Dygraph(new HTMLDivElement(), "data", {
6969
labelsSeparateLines: true,
7070
legend: "always",
7171
rangeSelectorForegroundStrokeColor: "white",
72+
resizable: "both",
7273
rollPeriod: 14,
7374
series: {
7475
y: {
@@ -233,6 +234,10 @@ d.setAnnotations([
233234
event;
234235
},
235236
},
237+
{
238+
series: "sine wave",
239+
xval: 20700,
240+
},
236241
]);
237242

238243
// $ExpectType Annotation[]

‎types/dygraphs/index.d.ts‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,17 @@ export namespace dygraphs {
777777
*/
778778
rangeSelectorPlotStrokeColor?: string | null | undefined;
779779

780+
/**
781+
* Whether to add a ResizeObserver to the container div ("passive") and additionally
782+
* make it resizable ("horizontal", "vertical", "both"). In any case, if the container
783+
* div has CSS "overflow:visible;" it will be changed to "overflow:hidden;" to make CSS
784+
* resizing possible. Note that this is distinct from resizing the graph when the window
785+
* size changes, which is always active; this feature adds user-resizable “handles” to
786+
* the container div.
787+
* @default no
788+
*/
789+
resizable?: "passive" | "horizontal" | "vertical" | "both" | "no" | undefined;
790+
780791
/**
781792
* Number of pixels to leave blank at the right edge of the Dygraph. This makes it easier to
782793
* highlight the right-most data point.
@@ -1100,6 +1111,12 @@ export namespace dygraphs {
11001111
*/
11011112
x?: number | string | undefined;
11021113

1114+
/**
1115+
* The numeric x value of the point, milliseconds since the epoch for a Date x axis.
1116+
* You must set either x or xval.
1117+
*/
1118+
xval?: number | undefined;
1119+
11031120
/** Text that will appear on the annotation's flag. */
11041121
shortText?: string | undefined;
11051122

0 commit comments

Comments
 (0)