Skip to content

Commit cf32d95

Browse files
authored
Merge pull request #6 from ramiy/master
Version 0.6.0
2 parents 71f3e7e + 6312435 commit cf32d95

20 files changed

+552
-416
lines changed

dist/charts.css

+257-186
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/charts.css.map

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/charts.min.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "charts.css",
3-
"version": "0.5.0",
3+
"version": "0.6.0",
44
"description": "Open source CSS framework for data visualization.",
55
"author": "Rami Yushuvaev",
66
"homepage": "https://ChartsCSS.org/",

src/charts.scss

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Charts.css v0.5.0 (https://ChartsCSS.org/)
2+
* Charts.css v0.6.0 (https://ChartsCSS.org/)
33
* Copyright 2020 Rami Yushuvaev
44
* Licensed under MIT
55
*/
@@ -10,6 +10,7 @@
1010

1111
// Components
1212
@import "components/wrapper";
13+
@import "components/heading";
1314
@import "components/colors";
1415
@import "components/data";
1516
@import "components/legend";

src/charts/_bar.scss

+40-40
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
.charts-css {
22

33
&.bar {
4-
// Shape
54
display: block;
65
width: 100%;
76

8-
--labels-size: 80px;
9-
10-
caption,
117
colgroup,
128
thead,
139
tfoot {
@@ -21,7 +17,7 @@
2117
align-items: stretch;
2218

2319
width: 100%;
24-
height: 100%;
20+
height: calc(100% - var(--heading-size));
2521

2622
tr {
2723
position: relative;
@@ -37,9 +33,6 @@
3733
justify-content: flex-start;
3834

3935
th {
40-
display: flex;
41-
align-items: center;
42-
4336
position: absolute;
4437
top: 0;
4538
bottom: 0;
@@ -59,17 +52,39 @@
5952
}
6053

6154
// Labels
62-
&.labels-hide {
55+
&:not(.show-labels) {
6356
--labels-size: 0;
64-
tbody {
65-
tr {
66-
th {
67-
display: none;
68-
}
69-
}
57+
58+
tbody tr th {
59+
display: none;
60+
}
61+
}
62+
&.show-labels {
63+
--labels-size: 80px;
64+
65+
tbody tr th {
66+
display: flex;
67+
align-items: center;
68+
}
69+
}
70+
&.labels-align-start {
71+
tbody tr th {
72+
justify-content: var(--labels-align, flex-start);
7073
}
7174
}
72-
&:not(.labels-after) {
75+
&.labels-align-end {
76+
tbody tr th {
77+
justify-content: var(--labels-align, flex-end);
78+
}
79+
}
80+
&.labels-align-center {
81+
tbody tr th {
82+
justify-content: var(--labels-align, center);
83+
}
84+
}
85+
86+
// Chart Direction
87+
&:not(.reverse) {
7388
tbody {
7489
tr {
7590
align-items: flex-start;
@@ -87,7 +102,7 @@
87102
}
88103
}
89104
}
90-
&.labels-after {
105+
&.reverse {
91106
tbody {
92107
tr {
93108
align-items: flex-end;
@@ -105,21 +120,6 @@
105120
}
106121
}
107122
}
108-
&.labels-align-start {
109-
tbody tr th {
110-
justify-content: var(--labels-align, flex-start);
111-
}
112-
}
113-
&.labels-align-end {
114-
tbody tr th {
115-
justify-content: var(--labels-align, flex-end);
116-
}
117-
}
118-
&.labels-align-center {
119-
tbody tr th {
120-
justify-content: var(--labels-align, center);
121-
}
122-
}
123123

124124
// Stacked
125125
&:not(.stacked) {
@@ -167,13 +167,13 @@
167167
}
168168

169169
&.stacked {
170-
&:not(.labels-after) {
170+
&:not(.reverse) {
171171
tbody tr {
172172
flex-direction: row;
173173
}
174174
}
175175

176-
&.labels-after {
176+
&.reverse {
177177
tbody tr {
178178
flex-direction: row-reverse;
179179
}
@@ -188,13 +188,13 @@
188188
}
189189

190190
&.stacked {
191-
&:not(.labels-after) {
191+
&:not(.reverse) {
192192
tbody tr {
193193
flex-direction: row-reverse;
194194
}
195195
}
196196

197-
&.labels-after {
197+
&.reverse {
198198
tbody tr {
199199
flex-direction: row;
200200
}
@@ -222,26 +222,26 @@
222222

223223
// Axes
224224
&.show-primary-axis {
225-
&:not(.labels-after) {
225+
&:not(.reverse) {
226226
tbody tr {
227227
border-inline-start: var(--primary-axis-width) var(--primary-axis-style) var(--primary-axis-color);
228228
}
229229
}
230-
&.labels-after {
230+
&.reverse {
231231
tbody tr {
232232
border-inline-end: var(--primary-axis-width) var(--primary-axis-style) var(--primary-axis-color);
233233
}
234234
}
235235
}
236236
@for $i from 1 through $max-axes {
237237
&.show-#{$i}-secondary-axes {
238-
&:not(.labels-after) {
238+
&:not(.reverse) {
239239
tbody tr {
240240
background-size: (100% / $i) 100%;
241241
background-image: linear-gradient(-90deg, var(--secondary-axes-color) var(--secondary-axes-width), transparent var(--secondary-axes-width));
242242
}
243243
}
244-
&.labels-after {
244+
&.reverse {
245245
tbody tr {
246246
background-size: (100% / $i) 100%;
247247
background-image: linear-gradient(90deg, var(--secondary-axes-color) var(--secondary-axes-width), transparent var(--secondary-axes-width));

src/charts/_bubble.scss

+15-7
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
11
.charts-css {
22

33
&.bubble {
4-
// Shape
5-
@include rectangle();
4+
display: block;
5+
width: 100%;
6+
height: 100%;
67

7-
// Background
8-
background-color: var(--chart-bg-color);
9-
10-
caption,
118
colgroup,
12-
tbody,
139
thead,
1410
tfoot {
1511
display: none;
1612
}
13+
14+
// Layout
15+
tbody {
16+
display: block;
17+
width: 100%;
18+
height: calc(100% - var(--heading-size));
19+
background-color: var(--chart-bg-color);
20+
21+
tr {
22+
display: none;
23+
}
24+
}
1725
}
1826

1927
}

0 commit comments

Comments
 (0)