Skip to content

Commit 113a5ac

Browse files
ryan-williamsclaude
andcommitted
convert heatmap/, contour/, waterfall/, funnel/, ohlc/, funnelarea/ to TypeScript
81 files with real types (GraphDiv, FullTrace, FullLayout, FullAxis, PlotInfo, CalcDatum, InputTrace). Total: 438 .ts / 397 .js (52% converted — now majority TypeScript). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 2523492 commit 113a5ac

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+199
-154
lines changed

perf/thresholds.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"bundleSize": {
33
"lite": {
4-
"expected_bytes": 1786972
4+
"expected_bytes": 1786976
55
},
66
"lite-min": {
77
"expected_bytes": 916326
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
import type { FullTrace, GraphDiv } from '../../../types/core';
12
import Colorscale from '../../components/colorscale/index.js';
23
import heatmapCalc from '../heatmap/calc.js';
34
import setContours from './set_contours.js';
45
import endPlus from './end_plus.js';
56

6-
export default function calc(gd, trace) {
7+
export default function calc(gd: GraphDiv, trace: FullTrace) {
78
var cd = heatmapCalc(gd, trace);
89

910
var zOut = cd[0].z;
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1+
import type { FullTrace, GraphDiv } from '../../../types/core';
12
import Colorscale from '../../components/colorscale/index.js';
23
import makeColorMap from './make_color_map.js';
34
import endPlus from './end_plus.js';
45

5-
function calc(gd, trace, opts) {
6+
function calc(gd: GraphDiv, trace: FullTrace, opts) {
67
var contours = trace.contours;
78
var line = trace.line;
89
var cs = contours.size || 1;
910
var coloring = contours.coloring;
10-
var colorMap = makeColorMap(trace, {isColorbar: true});
11+
var colorMap = (makeColorMap as any)(trace, {isColorbar: true});
1112

1213
if(coloring === 'heatmap') {
1314
var cOpts = Colorscale.extractOpts(trace);
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type { FullLayout, FullTrace, InputTrace } from '../../../types/core';
12
import isNumeric from 'fast-isnumeric';
23
import handleLabelDefaults from './label_defaults.js';
34
import Color from '../../components/color/index.js';
@@ -10,7 +11,7 @@ var opacity = Color.opacity;
1011
var CONSTRAINT_REDUCTION = filterOps.CONSTRAINT_REDUCTION;
1112
var COMPARISON_OPS2 = filterOps.COMPARISON_OPS2;
1213

13-
export default function handleConstraintDefaults(traceIn, traceOut, coerce, layout, defaultColor, opts) {
14+
export default function handleConstraintDefaults(traceIn: InputTrace, traceOut: FullTrace, coerce: any, layout: FullLayout, defaultColor: string, opts?: any) {
1415
var contours = traceOut.contours;
1516
var showLines, lineColor, fillColor;
1617

@@ -42,7 +43,7 @@ export default function handleConstraintDefaults(traceIn, traceOut, coerce, layo
4243
handleLabelDefaults(coerce, layout, lineColor, opts);
4344
}
4445

45-
function handleConstraintValueDefaults(coerce, contours) {
46+
function handleConstraintValueDefaults(coerce, contours) {
4647
var zvalue;
4748

4849
if(COMPARISON_OPS2.indexOf(contours.operation) === -1) {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ export default {
1111

1212
// This does not in any way shape or form support calendars. It's adapted from
1313
// transforms/filter.js.
14-
function coerceValue(operation, value) {
14+
function coerceValue(operation, value) {
1515
var hasArrayValue = Array.isArray(value);
1616

1717
var coercedValue;
1818

19-
function coerce(value) {
19+
function coerce(value: any) {
2020
return isNumeric(value) ? (+value) : null;
2121
}
2222

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
export default function handleContourDefaults(traceIn, traceOut, coerce, coerce2) {
1+
import type { FullTrace, InputTrace } from '../../../types/core';
2+
export default function handleContourDefaults(traceIn: InputTrace, traceOut: FullTrace, coerce: any, coerce2: any) {
23
var contourStart = coerce2('contours.start');
34
var contourEnd = coerce2('contours.end');
45
var missingEnd = (contourStart === false) || (contourEnd === false);
File renamed without changes.

0 commit comments

Comments
 (0)