Skip to content

Commit

Permalink
Merge pull request #6 from ramiy/master
Browse files Browse the repository at this point in the history
Version 0.6.0
  • Loading branch information
ramiy authored Oct 26, 2020
2 parents 71f3e7e + 6312435 commit cf32d95
Show file tree
Hide file tree
Showing 20 changed files with 552 additions and 416 deletions.
443 changes: 257 additions & 186 deletions dist/charts.css

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion dist/charts.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/charts.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "charts.css",
"version": "0.5.0",
"version": "0.6.0",
"description": "Open source CSS framework for data visualization.",
"author": "Rami Yushuvaev",
"homepage": "https://ChartsCSS.org/",
Expand Down
3 changes: 2 additions & 1 deletion src/charts.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Charts.css v0.5.0 (https://ChartsCSS.org/)
* Charts.css v0.6.0 (https://ChartsCSS.org/)
* Copyright 2020 Rami Yushuvaev
* Licensed under MIT
*/
Expand All @@ -10,6 +10,7 @@

// Components
@import "components/wrapper";
@import "components/heading";
@import "components/colors";
@import "components/data";
@import "components/legend";
Expand Down
80 changes: 40 additions & 40 deletions src/charts/_bar.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
.charts-css {

&.bar {
// Shape
display: block;
width: 100%;

--labels-size: 80px;

caption,
colgroup,
thead,
tfoot {
Expand All @@ -21,7 +17,7 @@
align-items: stretch;

width: 100%;
height: 100%;
height: calc(100% - var(--heading-size));

tr {
position: relative;
Expand All @@ -37,9 +33,6 @@
justify-content: flex-start;

th {
display: flex;
align-items: center;

position: absolute;
top: 0;
bottom: 0;
Expand All @@ -59,17 +52,39 @@
}

// Labels
&.labels-hide {
&:not(.show-labels) {
--labels-size: 0;
tbody {
tr {
th {
display: none;
}
}

tbody tr th {
display: none;
}
}
&.show-labels {
--labels-size: 80px;

tbody tr th {
display: flex;
align-items: center;
}
}
&.labels-align-start {
tbody tr th {
justify-content: var(--labels-align, flex-start);
}
}
&:not(.labels-after) {
&.labels-align-end {
tbody tr th {
justify-content: var(--labels-align, flex-end);
}
}
&.labels-align-center {
tbody tr th {
justify-content: var(--labels-align, center);
}
}

// Chart Direction
&:not(.reverse) {
tbody {
tr {
align-items: flex-start;
Expand All @@ -87,7 +102,7 @@
}
}
}
&.labels-after {
&.reverse {
tbody {
tr {
align-items: flex-end;
Expand All @@ -105,21 +120,6 @@
}
}
}
&.labels-align-start {
tbody tr th {
justify-content: var(--labels-align, flex-start);
}
}
&.labels-align-end {
tbody tr th {
justify-content: var(--labels-align, flex-end);
}
}
&.labels-align-center {
tbody tr th {
justify-content: var(--labels-align, center);
}
}

// Stacked
&:not(.stacked) {
Expand Down Expand Up @@ -167,13 +167,13 @@
}

&.stacked {
&:not(.labels-after) {
&:not(.reverse) {
tbody tr {
flex-direction: row;
}
}

&.labels-after {
&.reverse {
tbody tr {
flex-direction: row-reverse;
}
Expand All @@ -188,13 +188,13 @@
}

&.stacked {
&:not(.labels-after) {
&:not(.reverse) {
tbody tr {
flex-direction: row-reverse;
}
}

&.labels-after {
&.reverse {
tbody tr {
flex-direction: row;
}
Expand Down Expand Up @@ -222,26 +222,26 @@

// Axes
&.show-primary-axis {
&:not(.labels-after) {
&:not(.reverse) {
tbody tr {
border-inline-start: var(--primary-axis-width) var(--primary-axis-style) var(--primary-axis-color);
}
}
&.labels-after {
&.reverse {
tbody tr {
border-inline-end: var(--primary-axis-width) var(--primary-axis-style) var(--primary-axis-color);
}
}
}
@for $i from 1 through $max-axes {
&.show-#{$i}-secondary-axes {
&:not(.labels-after) {
&:not(.reverse) {
tbody tr {
background-size: (100% / $i) 100%;
background-image: linear-gradient(-90deg, var(--secondary-axes-color) var(--secondary-axes-width), transparent var(--secondary-axes-width));
}
}
&.labels-after {
&.reverse {
tbody tr {
background-size: (100% / $i) 100%;
background-image: linear-gradient(90deg, var(--secondary-axes-color) var(--secondary-axes-width), transparent var(--secondary-axes-width));
Expand Down
22 changes: 15 additions & 7 deletions src/charts/_bubble.scss
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
.charts-css {

&.bubble {
// Shape
@include rectangle();
display: block;
width: 100%;
height: 100%;

// Background
background-color: var(--chart-bg-color);

caption,
colgroup,
tbody,
thead,
tfoot {
display: none;
}

// Layout
tbody {
display: block;
width: 100%;
height: calc(100% - var(--heading-size));
background-color: var(--chart-bg-color);

tr {
display: none;
}
}
}

}
Loading

0 comments on commit cf32d95

Please sign in to comment.