Skip to content

Commit 87b6e0e

Browse files
committed
Minor refactoring
1 parent 044e900 commit 87b6e0e

2 files changed

Lines changed: 13 additions & 14 deletions

File tree

src/traces/image/attributes.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import type { AttributeMap } from '../../types/lib/attributes';
2-
1+
import { extendFlat } from '../../lib/extend';
32
import baseAttrs from '../../plots/attributes';
4-
import { zorder } from '../scatter/attributes';
53
import { hovertemplateAttrs, templatefallbackAttrs } from '../../plots/template_attributes';
6-
import { extendFlat } from '../../lib/extend';
4+
import type { AttributeMap } from '../../types/lib/attributes';
5+
import { zorder } from '../scatter/attributes';
76
import { colormodel } from './constants';
87

98
const cm = ['rgb', 'rgba', 'rgba256', 'hsl', 'hsla'] as const;

tasks/generate_schema_types.mjs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ let META_KEYS = new Set();
3030
// emitted as named type aliases in the output. Each anchor specifies a
3131
// PascalCase type name and a `match(key, path, values)` predicate. If multiple
3232
// enumerated attributes match the predicate, the one with the largest set of values
33-
// is chosen.
33+
// is chosen.
3434
// ---------------------------------------------------------------------------
3535

3636
const COMMON_TYPE_ANCHORS = [
@@ -70,14 +70,7 @@ const ATTR_NAME_OVERRIDES = new Map([['marker.symbol', 'MarkerSymbol']]);
7070
* Inside the namespace, sibling references are bare (`line?: Line`); outside,
7171
* references are prefixed (`marker?: _internal.Marker`) via `refName()`.
7272
*/
73-
const INTERNAL_INTERFACES = new Set([
74-
'AutoRangeOptions',
75-
'ErrorY',
76-
'Lighting',
77-
'Line',
78-
'Marker',
79-
'Stream'
80-
]);
73+
const INTERNAL_INTERFACES = new Set(['AutoRangeOptions', 'ErrorY', 'Lighting', 'Line', 'Marker', 'Stream']);
8174

8275
function refName(name, inInternalNamespace) {
8376
if (inInternalNamespace) return name;
@@ -807,7 +800,14 @@ function attrsToProperties(attrs, indent, pathPrefix, sharedTypes, fieldOverride
807800
lines.push(`${indent}${key}?: ${refName(sharedName, inInternalNamespace)}[];`);
808801
continue;
809802
}
810-
const nested = attrsToProperties(itemChild, indent + ' ', attrPath, sharedTypes, undefined, inInternalNamespace);
803+
const nested = attrsToProperties(
804+
itemChild,
805+
indent + ' ',
806+
attrPath,
807+
sharedTypes,
808+
undefined,
809+
inInternalNamespace
810+
);
811811
if (nested.length > 0) {
812812
lines.push(...formatJSDoc(val, indent));
813813
lines.push(`${indent}${key}?: Array<{`);

0 commit comments

Comments
 (0)