Skip to content

Commit

Permalink
Merge pull request #8 from ramiy/master
Browse files Browse the repository at this point in the history
Version 0.8.0
  • Loading branch information
ramiy authored Nov 19, 2020
2 parents 9e97129 + cdd90b3 commit 090eecd
Show file tree
Hide file tree
Showing 23 changed files with 1,925 additions and 1,457 deletions.
2,161 changes: 1,105 additions & 1,056 deletions dist/charts.css

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions 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.7.0",
"version": "0.8.0",
"description": "Open source CSS framework for data visualization.",
"author": "Rami Yushuvaev",
"homepage": "https://ChartsCSS.org/",
Expand Down
5 changes: 3 additions & 2 deletions src/charts.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Charts.css v0.7.0 (https://ChartsCSS.org/)
* Charts.css v0.8.0 (https://ChartsCSS.org/)
* Copyright 2020 Rami Yushuvaev
* Licensed under MIT
*/
Expand All @@ -13,14 +13,15 @@
@import "components/heading";
@import "components/colors";
@import "components/data";
@import "components/axes";
@import "components/legend";
@import "components/tooltips";

// Charts
@import "charts/bar";
@import "charts/column";
@import "charts/line";
@import "charts/area";
@import "charts/line";

@import "charts/radial";
@import "charts/pie";
Expand Down
94 changes: 6 additions & 88 deletions src/charts/_area.scss
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
/*
* Area Chart
*/
.charts-css {

&.area {
display: block;
width: 100%;
height: 100%;

colgroup,
thead,
tfoot {
display: none;
}

// Layout
tbody {
Expand Down Expand Up @@ -60,6 +54,7 @@
right: 0;
bottom: 0;
left: 0;
z-index: -1;
}

&::after {
Expand Down Expand Up @@ -241,92 +236,15 @@

// Spacing
@for $i from 1 through 20 {
&.data-spacing-#{$i} {
tbody tr {
padding-inline-start: $i * 1px;
padding-inline-end: $i * 1px;
}
}
}
@for $i from 1 through 20 {
&.data-spacing-#{$i},
&.datasets-spacing-#{$i} {
tbody tr td {
tbody tr td::before {
margin-inline-start: $i * 1px;
margin-inline-end: $i * 1px;
}
}
}

// Axes
&.show-primary-axis {
&:not(.reverse) {
tbody tr {
border-block-end: var(--primary-axis-width) var(--primary-axis-style) var(--primary-axis-color);
}
}
&.reverse {
tbody tr {
border-block-start: var(--primary-axis-width) var(--primary-axis-style) var(--primary-axis-color);
}
}
}
@for $i from 1 through $max-axes {
&.show-#{$i}-secondary-axes {
&:not(.reverse) {
tbody tr {
background-size: 100% (100% / $i);
background-image: linear-gradient(var(--secondary-axes-color) var(--secondary-axes-width), transparent var(--secondary-axes-width));
}
}
&.reverse {
tbody tr {
background-size: 100% (100% / $i);
background-image: linear-gradient(0deg, var(--secondary-axes-color) var(--secondary-axes-width), transparent var(--secondary-axes-width));
}
}
}
}
&.show-data-axes {
tbody tr {
border-inline-end: var(--data-axes-width) var(--data-axes-style) var(--data-axes-color);
}
&:not(.reverse-data) {
tbody tr:first-of-type {
border-inline-start: var(--data-axes-width) var(--data-axes-style) var(--data-axes-color);
}
}
&.reverse-data {
tbody tr:last-of-type {
border-inline-start: var(--data-axes-width) var(--data-axes-style) var(--data-axes-color);
}
}
}
&.show-dataset-axes { // TODO: fix this
tbody tr td {
border-inline-end: var(--data-axes-width) var(--data-axes-style) var(--data-axes-color);
}
&:not(.reverse-data) {
tbody tr:first-of-type td {
border-inline-start: var(--data-axes-width) var(--data-axes-style) var(--data-axes-color);
}
}
&.reverse-data {
tbody tr:last-of-type td {
border-inline-start: var(--data-axes-width) var(--data-axes-style) var(--data-axes-color);
}
}
}

// Hover
&.hover {
tr:hover {
background-color: var(--tr-hover-color, rgba(0, 0, 0, .05));
}
td:hover {
opacity: .75;
}
}

}

}
81 changes: 3 additions & 78 deletions src/charts/_bar.scss
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
/*
* Bar Chart
*/
.charts-css {

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

colgroup,
thead,
tfoot {
display: none;
}

// Layout
tbody {
Expand Down Expand Up @@ -220,76 +215,6 @@
}
}

// Axes
&.show-primary-axis {
&:not(.reverse) {
tbody tr {
border-inline-start: var(--primary-axis-width) var(--primary-axis-style) var(--primary-axis-color);
}
}
&.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(.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));
}
}
&.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));
}
}
}
}
&.show-data-axes {
tbody tr {
border-block-end: var(--data-axes-width) var(--data-axes-style) var(--data-axes-color);
}
&:not(.reverse-data) {
tbody tr:first-of-type {
border-block-start: var(--data-axes-width) var(--data-axes-style) var(--data-axes-color);
}
}
&.reverse-data {
tbody tr:last-of-type {
border-block-start: var(--data-axes-width) var(--data-axes-style) var(--data-axes-color);
}
}
}
&.show-dataset-axes { // TODO: fix this
tbody tr td {
border-block-end: var(--data-axes-width) var(--data-axes-style) var(--data-axes-color);
}
&:not(.reverse-data) {
tbody tr:first-of-type td {
border-block-start: var(--data-axes-width) var(--data-axes-style) var(--data-axes-color);
}
}
&.reverse-data {
tbody tr:last-of-type td {
border-block-start: var(--data-axes-width) var(--data-axes-style) var(--data-axes-color);
}
}
}

// Hover
&.hover {
tr:hover {
background-color: var(--tr-hover-color, rgba(0, 0, 0, .05));
}
td:hover {
opacity: .75;
}
}

}

}
82 changes: 3 additions & 79 deletions src/charts/_column.scss
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
/*
* Column Chart
*/
.charts-css {

&.column {
display: block;
width: 100%;
height: 100%;

colgroup,
thead,
tfoot {
display: none;
}

// Layout
tbody {
Expand Down Expand Up @@ -220,76 +214,6 @@
}
}

// Axes
&.show-primary-axis {
&:not(.reverse) {
tbody tr {
border-block-end: var(--primary-axis-width) var(--primary-axis-style) var(--primary-axis-color);
}
}
&.reverse {
tbody tr {
border-block-start: var(--primary-axis-width) var(--primary-axis-style) var(--primary-axis-color);
}
}
}
@for $i from 1 through $max-axes {
&.show-#{$i}-secondary-axes {
&:not(.reverse) {
tbody tr {
background-size: 100% (100% / $i);
background-image: linear-gradient(var(--secondary-axes-color) var(--secondary-axes-width), transparent var(--secondary-axes-width));
}
}
&.reverse {
tbody tr {
background-size: 100% (100% / $i);
background-image: linear-gradient(0deg, var(--secondary-axes-color) var(--secondary-axes-width), transparent var(--secondary-axes-width));
}
}
}
}
&.show-data-axes {
tbody tr {
border-inline-end: var(--data-axes-width) var(--data-axes-style) var(--data-axes-color);
}
&:not(.reverse-data) {
tbody tr:first-of-type {
border-inline-start: var(--data-axes-width) var(--data-axes-style) var(--data-axes-color);
}
}
&.reverse-data {
tbody tr:last-of-type {
border-inline-start: var(--data-axes-width) var(--data-axes-style) var(--data-axes-color);
}
}
}
&.show-dataset-axes { // TODO: fix this
tbody tr td {
border-inline-end: var(--data-axes-width) var(--data-axes-style) var(--data-axes-color);
}
&:not(.reverse-data) {
tbody tr:first-of-type td {
border-inline-start: var(--data-axes-width) var(--data-axes-style) var(--data-axes-color);
}
}
&.reverse-data {
tbody tr:last-of-type td {
border-inline-start: var(--data-axes-width) var(--data-axes-style) var(--data-axes-color);
}
}
}

// Hover
&.hover {
tr:hover {
background-color: var(--tr-hover-color, rgba(0, 0, 0, .05));
}
td:hover {
opacity: .75;
}
}

}

}
12 changes: 3 additions & 9 deletions src/charts/_donut.scss
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
/*
* Donut Chart
*/
.charts-css {

&.donut {
display: block;
width: 100%;
height: 100%;

colgroup,
thead,
tfoot {
display: none;
}

// Layout
tbody {
Expand Down
Loading

0 comments on commit 090eecd

Please sign in to comment.