@malloydata/render 0.0.22-dev230207182613 → 0.0.22-dev230207183024
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/drill.js +7 -7
- package/dist/html/cartesian_chart.js +28 -28
- package/dist/html/chart.js +6 -6
- package/dist/html/container.js +2 -2
- package/dist/html/currency.js +2 -2
- package/dist/html/dashboard.js +1 -1
- package/dist/html/html_view.d.ts +1 -1
- package/dist/html/html_view.js +1 -1
- package/dist/html/list.d.ts +1 -1
- package/dist/html/list.js +1 -1
- package/dist/html/percent.js +1 -1
- package/dist/html/point_map.js +64 -64
- package/dist/html/segment_map.js +56 -56
- package/dist/html/shape_map.js +64 -64
- package/dist/html/state_codes.js +96 -96
- package/dist/html/table.js +1 -1
- package/dist/html/utils.js +10 -10
- package/dist/html/vega_spec.js +277 -277
- package/package.json +2 -2
package/dist/html/shape_map.js
CHANGED
|
@@ -92,88 +92,88 @@ class HTMLShapeMapRenderer extends chart_1.HTMLChartRenderer {
|
|
|
92
92
|
const colorType = colorField ? this.getDataType(colorField) : undefined;
|
|
93
93
|
const colorDef = colorField !== undefined
|
|
94
94
|
? {
|
|
95
|
-
field: colorField.name,
|
|
96
|
-
type: colorType,
|
|
97
|
-
axis: { title: colorField.name },
|
|
98
|
-
scale: (0, utils_1.getColorScale)(colorType, false)
|
|
95
|
+
"field": colorField.name,
|
|
96
|
+
"type": colorType,
|
|
97
|
+
"axis": { "title": colorField.name },
|
|
98
|
+
"scale": (0, utils_1.getColorScale)(colorType, false)
|
|
99
99
|
}
|
|
100
100
|
: undefined;
|
|
101
101
|
const mapped = this.mapData(data).filter((row) => row[regionField.name] !== undefined);
|
|
102
102
|
return {
|
|
103
103
|
...this.getSize(),
|
|
104
|
-
data: { values: mapped },
|
|
105
|
-
projection: {
|
|
106
|
-
type: "albersUsa"
|
|
104
|
+
"data": { "values": mapped },
|
|
105
|
+
"projection": {
|
|
106
|
+
"type": "albersUsa"
|
|
107
107
|
},
|
|
108
|
-
layer: [
|
|
108
|
+
"layer": [
|
|
109
109
|
{
|
|
110
|
-
data: {
|
|
111
|
-
values: states_10m_json_1.default,
|
|
112
|
-
format: {
|
|
113
|
-
type: "topojson",
|
|
114
|
-
feature: "states"
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
mark: {
|
|
118
|
-
type: "geoshape",
|
|
119
|
-
fill: "#efefef",
|
|
120
|
-
stroke: "white",
|
|
110
|
+
"data": {
|
|
111
|
+
"values": states_10m_json_1.default,
|
|
112
|
+
"format": {
|
|
113
|
+
"type": "topojson",
|
|
114
|
+
"feature": "states"
|
|
115
|
+
}
|
|
121
116
|
},
|
|
117
|
+
"mark": {
|
|
118
|
+
"type": "geoshape",
|
|
119
|
+
"fill": "#efefef",
|
|
120
|
+
"stroke": "white"
|
|
121
|
+
}
|
|
122
122
|
},
|
|
123
123
|
{
|
|
124
|
-
transform: [
|
|
124
|
+
"transform": [
|
|
125
125
|
{
|
|
126
|
-
lookup: regionField.name,
|
|
127
|
-
from: {
|
|
128
|
-
data: {
|
|
129
|
-
values: states_10m_json_1.default,
|
|
130
|
-
format: {
|
|
131
|
-
type: "topojson",
|
|
132
|
-
feature: "states"
|
|
133
|
-
}
|
|
126
|
+
"lookup": regionField.name,
|
|
127
|
+
"from": {
|
|
128
|
+
"data": {
|
|
129
|
+
"values": states_10m_json_1.default,
|
|
130
|
+
"format": {
|
|
131
|
+
"type": "topojson",
|
|
132
|
+
"feature": "states"
|
|
133
|
+
}
|
|
134
134
|
},
|
|
135
|
-
key: "id"
|
|
135
|
+
"key": "id"
|
|
136
136
|
},
|
|
137
|
-
as: "geo"
|
|
138
|
-
}
|
|
137
|
+
"as": "geo"
|
|
138
|
+
}
|
|
139
139
|
],
|
|
140
|
-
mark: "geoshape",
|
|
141
|
-
encoding: {
|
|
142
|
-
shape: { field: "geo", type: "geojson" },
|
|
143
|
-
color: colorDef
|
|
144
|
-
}
|
|
145
|
-
}
|
|
140
|
+
"mark": "geoshape",
|
|
141
|
+
"encoding": {
|
|
142
|
+
"shape": { "field": "geo", "type": "geojson" },
|
|
143
|
+
"color": colorDef
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
146
|
],
|
|
147
|
-
background: "transparent",
|
|
148
|
-
config: {
|
|
149
|
-
axis: {
|
|
150
|
-
labelFont: "var(--malloy-font-family, Roboto)",
|
|
151
|
-
titleFont: "var(--malloy-font-family, Roboto)",
|
|
152
|
-
titleFontWeight: 500,
|
|
153
|
-
titleColor: "var(--malloy-title-color, #505050)",
|
|
154
|
-
labelColor: "var(--malloy-label-color, #000000)",
|
|
155
|
-
titleFontSize: 12
|
|
147
|
+
"background": "transparent",
|
|
148
|
+
"config": {
|
|
149
|
+
"axis": {
|
|
150
|
+
"labelFont": "var(--malloy-font-family, Roboto)",
|
|
151
|
+
"titleFont": "var(--malloy-font-family, Roboto)",
|
|
152
|
+
"titleFontWeight": 500,
|
|
153
|
+
"titleColor": "var(--malloy-title-color, #505050)",
|
|
154
|
+
"labelColor": "var(--malloy-label-color, #000000)",
|
|
155
|
+
"titleFontSize": 12
|
|
156
156
|
},
|
|
157
|
-
legend: {
|
|
158
|
-
labelFont: "var(--malloy-font-family, Roboto)",
|
|
159
|
-
titleFont: "var(--malloy-font-family, Roboto)",
|
|
160
|
-
titleFontWeight: 500,
|
|
161
|
-
titleColor: "var(--malloy-title-color, #505050)",
|
|
162
|
-
labelColor: "var(--malloy-label-color, #000000)",
|
|
163
|
-
titleFontSize: 12
|
|
157
|
+
"legend": {
|
|
158
|
+
"labelFont": "var(--malloy-font-family, Roboto)",
|
|
159
|
+
"titleFont": "var(--malloy-font-family, Roboto)",
|
|
160
|
+
"titleFontWeight": 500,
|
|
161
|
+
"titleColor": "var(--malloy-title-color, #505050)",
|
|
162
|
+
"labelColor": "var(--malloy-label-color, #000000)",
|
|
163
|
+
"titleFontSize": 12
|
|
164
164
|
},
|
|
165
|
-
header: {
|
|
166
|
-
labelFont: "var(--malloy-font-family, Roboto)",
|
|
167
|
-
titleFont: "var(--malloy-font-family, Roboto)",
|
|
168
|
-
titleFontWeight: 500
|
|
165
|
+
"header": {
|
|
166
|
+
"labelFont": "var(--malloy-font-family, Roboto)",
|
|
167
|
+
"titleFont": "var(--malloy-font-family, Roboto)",
|
|
168
|
+
"titleFontWeight": 500
|
|
169
169
|
},
|
|
170
|
-
mark: { font: "var(--malloy-font-family, Roboto)" },
|
|
171
|
-
title: {
|
|
172
|
-
font: "var(--malloy-font-family, Roboto)",
|
|
173
|
-
subtitleFont: "var(--malloy-font-family, Roboto)",
|
|
174
|
-
fontWeight: 500
|
|
175
|
-
}
|
|
176
|
-
}
|
|
170
|
+
"mark": { "font": "var(--malloy-font-family, Roboto)" },
|
|
171
|
+
"title": {
|
|
172
|
+
"font": "var(--malloy-font-family, Roboto)",
|
|
173
|
+
"subtitleFont": "var(--malloy-font-family, Roboto)",
|
|
174
|
+
"fontWeight": 500
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
177
|
};
|
|
178
178
|
}
|
|
179
179
|
}
|
package/dist/html/state_codes.js
CHANGED
|
@@ -25,113 +25,113 @@ exports.STATE_CODES = void 0;
|
|
|
25
25
|
*/
|
|
26
26
|
// force a branch
|
|
27
27
|
exports.STATE_CODES = {
|
|
28
|
-
AL: "01",
|
|
29
|
-
Alabama: "01",
|
|
30
|
-
AK: "02",
|
|
31
|
-
Alaska: "02",
|
|
32
|
-
AZ: "04",
|
|
33
|
-
Arizona: "04",
|
|
34
|
-
AR: "05",
|
|
35
|
-
Arkansas: "05",
|
|
36
|
-
CA: "06",
|
|
37
|
-
California: "06",
|
|
38
|
-
CO: "08",
|
|
39
|
-
Colorado: "08",
|
|
40
|
-
CT: "09",
|
|
41
|
-
Connecticut: "09",
|
|
42
|
-
DE: "10",
|
|
43
|
-
Delaware: "10",
|
|
44
|
-
DC: "11",
|
|
28
|
+
"AL": "01",
|
|
29
|
+
"Alabama": "01",
|
|
30
|
+
"AK": "02",
|
|
31
|
+
"Alaska": "02",
|
|
32
|
+
"AZ": "04",
|
|
33
|
+
"Arizona": "04",
|
|
34
|
+
"AR": "05",
|
|
35
|
+
"Arkansas": "05",
|
|
36
|
+
"CA": "06",
|
|
37
|
+
"California": "06",
|
|
38
|
+
"CO": "08",
|
|
39
|
+
"Colorado": "08",
|
|
40
|
+
"CT": "09",
|
|
41
|
+
"Connecticut": "09",
|
|
42
|
+
"DE": "10",
|
|
43
|
+
"Delaware": "10",
|
|
44
|
+
"DC": "11",
|
|
45
45
|
"District of Columbia": "11",
|
|
46
|
-
FL: "12",
|
|
47
|
-
Florida: "12",
|
|
48
|
-
GA: "13",
|
|
49
|
-
Georgia: "13",
|
|
50
|
-
HI: "15",
|
|
51
|
-
Hawaii: "12",
|
|
52
|
-
ID: "16",
|
|
53
|
-
Idaho: "16",
|
|
54
|
-
IL: "17",
|
|
55
|
-
Illinois: "17",
|
|
56
|
-
IN: "18",
|
|
57
|
-
Indiana: "18",
|
|
58
|
-
IA: "19",
|
|
59
|
-
Iowa: "19",
|
|
60
|
-
KS: "20",
|
|
61
|
-
Kansas: "20",
|
|
62
|
-
KY: "21",
|
|
63
|
-
Kentucky: "21",
|
|
64
|
-
LA: "22",
|
|
65
|
-
Louisiana: "22",
|
|
66
|
-
ME: "23",
|
|
67
|
-
Maine: "23",
|
|
68
|
-
MD: "24",
|
|
69
|
-
Maryland: "24",
|
|
70
|
-
MA: "25",
|
|
71
|
-
Massachusetts: "25",
|
|
72
|
-
MI: "26",
|
|
73
|
-
Michigan: "26",
|
|
74
|
-
MN: "27",
|
|
75
|
-
Minnesota: "27",
|
|
76
|
-
MS: "28",
|
|
77
|
-
Mississippi: "28",
|
|
78
|
-
MO: "29",
|
|
79
|
-
Missouri: "29",
|
|
80
|
-
MT: "30",
|
|
81
|
-
Montana: "30",
|
|
82
|
-
NE: "31",
|
|
83
|
-
Nebraska: "31",
|
|
84
|
-
NV: "32",
|
|
85
|
-
Nevada: "32",
|
|
86
|
-
NH: "33",
|
|
46
|
+
"FL": "12",
|
|
47
|
+
"Florida": "12",
|
|
48
|
+
"GA": "13",
|
|
49
|
+
"Georgia": "13",
|
|
50
|
+
"HI": "15",
|
|
51
|
+
"Hawaii": "12",
|
|
52
|
+
"ID": "16",
|
|
53
|
+
"Idaho": "16",
|
|
54
|
+
"IL": "17",
|
|
55
|
+
"Illinois": "17",
|
|
56
|
+
"IN": "18",
|
|
57
|
+
"Indiana": "18",
|
|
58
|
+
"IA": "19",
|
|
59
|
+
"Iowa": "19",
|
|
60
|
+
"KS": "20",
|
|
61
|
+
"Kansas": "20",
|
|
62
|
+
"KY": "21",
|
|
63
|
+
"Kentucky": "21",
|
|
64
|
+
"LA": "22",
|
|
65
|
+
"Louisiana": "22",
|
|
66
|
+
"ME": "23",
|
|
67
|
+
"Maine": "23",
|
|
68
|
+
"MD": "24",
|
|
69
|
+
"Maryland": "24",
|
|
70
|
+
"MA": "25",
|
|
71
|
+
"Massachusetts": "25",
|
|
72
|
+
"MI": "26",
|
|
73
|
+
"Michigan": "26",
|
|
74
|
+
"MN": "27",
|
|
75
|
+
"Minnesota": "27",
|
|
76
|
+
"MS": "28",
|
|
77
|
+
"Mississippi": "28",
|
|
78
|
+
"MO": "29",
|
|
79
|
+
"Missouri": "29",
|
|
80
|
+
"MT": "30",
|
|
81
|
+
"Montana": "30",
|
|
82
|
+
"NE": "31",
|
|
83
|
+
"Nebraska": "31",
|
|
84
|
+
"NV": "32",
|
|
85
|
+
"Nevada": "32",
|
|
86
|
+
"NH": "33",
|
|
87
87
|
"New Hampshire": "33",
|
|
88
|
-
NJ: "34",
|
|
88
|
+
"NJ": "34",
|
|
89
89
|
"New Jersey": "34",
|
|
90
|
-
NM: "35",
|
|
90
|
+
"NM": "35",
|
|
91
91
|
"New Mexico": "35",
|
|
92
|
-
NY: "36",
|
|
92
|
+
"NY": "36",
|
|
93
93
|
"New York": "36",
|
|
94
|
-
NC: "37",
|
|
94
|
+
"NC": "37",
|
|
95
95
|
"North Carolina": "37",
|
|
96
|
-
ND: "38",
|
|
96
|
+
"ND": "38",
|
|
97
97
|
"North Dakota": "38",
|
|
98
|
-
OH: "39",
|
|
99
|
-
Ohio: "39",
|
|
100
|
-
OK: "40",
|
|
101
|
-
Oklahoma: "40",
|
|
102
|
-
OR: "41",
|
|
103
|
-
Oregon: "41",
|
|
104
|
-
PA: "42",
|
|
105
|
-
Pennsylvania: "42",
|
|
106
|
-
RI: "44",
|
|
98
|
+
"OH": "39",
|
|
99
|
+
"Ohio": "39",
|
|
100
|
+
"OK": "40",
|
|
101
|
+
"Oklahoma": "40",
|
|
102
|
+
"OR": "41",
|
|
103
|
+
"Oregon": "41",
|
|
104
|
+
"PA": "42",
|
|
105
|
+
"Pennsylvania": "42",
|
|
106
|
+
"RI": "44",
|
|
107
107
|
"Rhode Island": "44",
|
|
108
|
-
SC: "45",
|
|
108
|
+
"SC": "45",
|
|
109
109
|
"South Carolina": "45",
|
|
110
|
-
SD: "46",
|
|
110
|
+
"SD": "46",
|
|
111
111
|
"South Dakota": "46",
|
|
112
|
-
TN: "47",
|
|
113
|
-
Tennessee: "47",
|
|
114
|
-
TX: "48",
|
|
115
|
-
Texas: "48",
|
|
116
|
-
UT: "49",
|
|
117
|
-
Utah: "49",
|
|
118
|
-
VT: "50",
|
|
119
|
-
Vermont: "50",
|
|
120
|
-
VA: "51",
|
|
121
|
-
Virginia: "51",
|
|
122
|
-
WA: "53",
|
|
123
|
-
Washington: "53",
|
|
124
|
-
WV: "54",
|
|
112
|
+
"TN": "47",
|
|
113
|
+
"Tennessee": "47",
|
|
114
|
+
"TX": "48",
|
|
115
|
+
"Texas": "48",
|
|
116
|
+
"UT": "49",
|
|
117
|
+
"Utah": "49",
|
|
118
|
+
"VT": "50",
|
|
119
|
+
"Vermont": "50",
|
|
120
|
+
"VA": "51",
|
|
121
|
+
"Virginia": "51",
|
|
122
|
+
"WA": "53",
|
|
123
|
+
"Washington": "53",
|
|
124
|
+
"WV": "54",
|
|
125
125
|
"West Virginia": "54",
|
|
126
|
-
WI: "55",
|
|
127
|
-
Wisconsin: "55",
|
|
128
|
-
WY: "56",
|
|
129
|
-
Wyoming: "56",
|
|
130
|
-
PR: "72",
|
|
126
|
+
"WI": "55",
|
|
127
|
+
"Wisconsin": "55",
|
|
128
|
+
"WY": "56",
|
|
129
|
+
"Wyoming": "56",
|
|
130
|
+
"PR": "72",
|
|
131
131
|
"Puerto Rico": "72",
|
|
132
|
-
VI: "78",
|
|
133
|
-
AS: "60",
|
|
134
|
-
MP: "69",
|
|
135
|
-
GU: "66"
|
|
132
|
+
"VI": "78",
|
|
133
|
+
"AS": "60",
|
|
134
|
+
"MP": "69",
|
|
135
|
+
"GU": "66"
|
|
136
136
|
};
|
|
137
137
|
//# sourceMappingURL=state_codes.js.map
|
package/dist/html/table.js
CHANGED
package/dist/html/utils.js
CHANGED
|
@@ -30,18 +30,18 @@ function getColorScale(type, isRectMark, hasOverlappingText = false) {
|
|
|
30
30
|
}
|
|
31
31
|
switch (type) {
|
|
32
32
|
case "ordinal":
|
|
33
|
-
return { range: ["#C2D5EE", "#1A73E8"] };
|
|
33
|
+
return { "range": ["#C2D5EE", "#1A73E8"] };
|
|
34
34
|
case "temporal":
|
|
35
35
|
case "quantitative":
|
|
36
36
|
return isRectMark
|
|
37
37
|
? hasOverlappingText
|
|
38
|
-
? { range: ["#6BA4EE", "#EEA361"] }
|
|
39
|
-
: { range: ["#1A73E8", "#E8710A"] }
|
|
40
|
-
: { range: ["#C2D5EE", "#1A73E8"] };
|
|
38
|
+
? { "range": ["#6BA4EE", "#EEA361"] }
|
|
39
|
+
: { "range": ["#1A73E8", "#E8710A"] }
|
|
40
|
+
: { "range": ["#C2D5EE", "#1A73E8"] };
|
|
41
41
|
case "nominal":
|
|
42
42
|
return hasOverlappingText
|
|
43
43
|
? {
|
|
44
|
-
range: [
|
|
44
|
+
"range": [
|
|
45
45
|
"#6BA4EE",
|
|
46
46
|
"#66CEDC",
|
|
47
47
|
"#EC72B8",
|
|
@@ -49,11 +49,11 @@ function getColorScale(type, isRectMark, hasOverlappingText = false) {
|
|
|
49
49
|
"#F9C85B",
|
|
50
50
|
"#AACD85",
|
|
51
51
|
"#B87CED",
|
|
52
|
-
"#ACB0B3"
|
|
53
|
-
]
|
|
52
|
+
"#ACB0B3"
|
|
53
|
+
]
|
|
54
54
|
}
|
|
55
55
|
: {
|
|
56
|
-
range: [
|
|
56
|
+
"range": [
|
|
57
57
|
"#1A73E8",
|
|
58
58
|
"#12B5CB",
|
|
59
59
|
"#E52592",
|
|
@@ -61,8 +61,8 @@ function getColorScale(type, isRectMark, hasOverlappingText = false) {
|
|
|
61
61
|
"#F9AB00",
|
|
62
62
|
"#7CB342",
|
|
63
63
|
"#9334E6",
|
|
64
|
-
"#80868B"
|
|
65
|
-
]
|
|
64
|
+
"#80868B"
|
|
65
|
+
]
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
68
|
}
|