@cdc/waffle-chart 1.0.0 → 1.0.1
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/cdcwafflechart.js +2 -2
- package/package.json +12 -14
- package/src/CdcWaffleChart.tsx +127 -125
- package/src/{context.js → ConfigContext.js} +0 -0
- package/src/components/EditorPanel.js +281 -350
- package/src/data/initial-state.js +8 -1
- package/src/scss/main.scss +1 -4
- package/src/scss/waffle-chart.scss +42 -69
- package/src/scss/editor-panel.scss +0 -710
- package/src/scss/responsive.scss +0 -1
- package/src/scss/variables.scss +0 -29
|
@@ -23,5 +23,12 @@ export default {
|
|
|
23
23
|
"nodeWidth": "10",
|
|
24
24
|
"nodeSpacer": "2",
|
|
25
25
|
"theme": "theme-blue",
|
|
26
|
-
"type": "waffle-chart"
|
|
26
|
+
"type": "waffle-chart",
|
|
27
|
+
"visual": {
|
|
28
|
+
"border": false,
|
|
29
|
+
"accent": false,
|
|
30
|
+
"background": false,
|
|
31
|
+
"hideBackgroundColor": false,
|
|
32
|
+
"borderColorTheme": false
|
|
33
|
+
}
|
|
27
34
|
}
|
package/src/scss/main.scss
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
@import '~@cdc/core/styles/
|
|
2
|
-
@import "~@cdc/core/styles/heading-colors";
|
|
3
|
-
@import 'variables';
|
|
1
|
+
@import '~@cdc/core/styles/v2/main';
|
|
4
2
|
@import 'waffle-chart';
|
|
5
3
|
|
|
6
4
|
.cdc-open-viz-module.type-waffle-chart {
|
|
7
|
-
@import 'editor-panel';
|
|
8
5
|
|
|
9
6
|
.loader {
|
|
10
7
|
width: 100%;
|
|
@@ -8,120 +8,93 @@
|
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
border-top: none;
|
|
15
|
-
box-shadow: rgba(0, 0, 0, 0.2) 3px 6px 10px;
|
|
16
|
-
background: $lightestGray;
|
|
17
|
-
overflow: hidden;
|
|
18
|
-
|
|
19
|
-
@at-root .is-editor #{&} {
|
|
20
|
-
margin: 3em auto 0;
|
|
21
|
-
max-width: 35em;
|
|
22
|
-
}
|
|
11
|
+
.cove .waffle-chart .cove-component__header {
|
|
12
|
+
font-size: unset;
|
|
13
|
+
}
|
|
23
14
|
|
|
24
|
-
|
|
15
|
+
//@each $theme, $color in $theme-colors {
|
|
16
|
+
// .cdc-waffle-chart.theme-#{$theme} #{&} {
|
|
17
|
+
// @include set-theme("color", $color);
|
|
18
|
+
// }
|
|
19
|
+
//}
|
|
20
|
+
|
|
21
|
+
.cove {
|
|
22
|
+
.cove-waffle-chart {
|
|
25
23
|
display: flex;
|
|
26
24
|
flex-wrap: wrap;
|
|
27
25
|
padding: 1em 1em 0;
|
|
28
26
|
justify-content: flex-start;
|
|
29
27
|
|
|
30
|
-
&.
|
|
28
|
+
&.cove-waffle-chart--verical {
|
|
31
29
|
align-items: center;
|
|
32
30
|
flex-flow: column;
|
|
33
31
|
|
|
34
|
-
.
|
|
32
|
+
.cove-waffle-chart__chart {
|
|
35
33
|
padding-right: 0;
|
|
36
34
|
}
|
|
37
35
|
|
|
38
|
-
.
|
|
36
|
+
.cove-waffle-chart__data {
|
|
39
37
|
text-align: center;
|
|
38
|
+
// display: flex;
|
|
39
|
+
// flex-wrap: wrap;
|
|
40
|
+
// align-content: space-between;
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
44
|
|
|
44
|
-
.
|
|
45
|
+
.cove-waffle-chart__chart {
|
|
45
46
|
padding-right: 1rem;
|
|
46
47
|
margin-bottom: 1rem;
|
|
47
48
|
box-sizing: content-box;
|
|
48
49
|
}
|
|
49
50
|
|
|
50
|
-
.
|
|
51
|
+
.cove-waffle-chart__data {
|
|
51
52
|
flex: 1 1 0;
|
|
52
53
|
min-width: 175px;
|
|
53
54
|
margin-bottom: 1rem;
|
|
54
55
|
}
|
|
55
56
|
|
|
56
|
-
.
|
|
57
|
+
.cove-waffle-chart__subtext {
|
|
57
58
|
font-style: italic;
|
|
58
59
|
font-weight: bold;
|
|
59
60
|
font-size: 0.75em;
|
|
60
61
|
padding: 0 1em 1em;
|
|
61
62
|
}
|
|
62
|
-
}
|
|
63
63
|
|
|
64
|
-
.
|
|
65
|
-
@at-root {
|
|
66
|
-
.cdc-waffle-chart #{&} {
|
|
67
|
-
width: 100%;
|
|
68
|
-
padding: 0.6em 0.8em;
|
|
69
|
-
margin: 0 !important;
|
|
70
|
-
border-bottom-width: 3px;
|
|
71
|
-
border-bottom-style: solid;
|
|
72
|
-
font-size: 1.1em;
|
|
73
|
-
color: white;
|
|
74
|
-
}
|
|
64
|
+
.cove-waffle-chart__data {
|
|
75
65
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
.cdc-waffle-chart.theme-#{$theme} #{&} {
|
|
83
|
-
@include set-theme("border-color", $color);
|
|
66
|
+
font-size: 14px;
|
|
67
|
+
|
|
68
|
+
@at-root {
|
|
69
|
+
.cove-waffle-chart.font-small #{&} {
|
|
70
|
+
.cove-waffle-chart__data--primary { font-size: 35px; }
|
|
71
|
+
.cove-waffle-chart__data--text { font-size: 14px; }
|
|
84
72
|
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
73
|
|
|
89
|
-
.
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
.cdc-waffle-chart.theme-#{$theme} #{&} {
|
|
93
|
-
@include set-theme("color", $color);
|
|
74
|
+
.cove-waffle-chart.font-medium #{&} {
|
|
75
|
+
.cove-waffle-chart__data--primary { font-size: 50px; }
|
|
76
|
+
.cove-waffle-chart__data--text { font-size: 18px; }
|
|
94
77
|
}
|
|
95
|
-
}
|
|
96
78
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
79
|
+
.cove-waffle-chart.font-large #{&} {
|
|
80
|
+
.cove-waffle-chart__data--primary { font-size: 80px; }
|
|
81
|
+
.cove-waffle-chart__data--text { font-size: 20px; }
|
|
82
|
+
}
|
|
100
83
|
}
|
|
101
84
|
|
|
102
|
-
.
|
|
103
|
-
|
|
104
|
-
|
|
85
|
+
.cove-waffle-chart__data--primary {
|
|
86
|
+
font-size: 70px;
|
|
87
|
+
font-weight: 400;
|
|
88
|
+
line-height: 1em;
|
|
105
89
|
}
|
|
106
90
|
|
|
107
|
-
.
|
|
108
|
-
|
|
109
|
-
.cdc-waffle-chart__data--text { font-size: 20px; }
|
|
91
|
+
.cove-waffle-chart__data--text {
|
|
92
|
+
line-height: 1.25em;
|
|
110
93
|
}
|
|
111
94
|
}
|
|
112
95
|
|
|
113
|
-
.
|
|
114
|
-
|
|
115
|
-
font-weight: 400;
|
|
116
|
-
line-height: 1em;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
.cdc-waffle-chart__data--text {
|
|
120
|
-
font-weight: 300;
|
|
121
|
-
line-height: 1.25em;
|
|
96
|
+
.cove-waffle-chart__node {
|
|
97
|
+
transition: all 300ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
122
98
|
}
|
|
123
|
-
}
|
|
124
99
|
|
|
125
|
-
.cdc-waffle-chart__node {
|
|
126
|
-
transition: all 300ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
127
100
|
}
|