Skip to content

Commit

Permalink
0.10.0-beta.17
Browse files Browse the repository at this point in the history
New:
- Split size legend items by square root, reduced count.
- Changed legend Reset button style.
  • Loading branch information
alexanderby committed Feb 8, 2017
1 parent 308d04e commit c0441c8
Show file tree
Hide file tree
Showing 11 changed files with 56 additions and 78 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "taucharts",
"version": "0.10.0-beta.16",
"version": "0.10.0-beta.17",
"homepage": "https://github.com/TargetProcess/tauCharts",
"description": "D3 based data-focused charting library",
"keywords": [
Expand Down
27 changes: 7 additions & 20 deletions build/development/plugins/tauCharts.legend.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,41 +25,28 @@
font-size: 13px;
}
.graphical-report__legend__reset {
background-color: #fff;
background-color: rgba(255, 255, 255, 0.9);
border: 1px solid #b3b3b3;
border-radius: 12px;
box-sizing: content-box;
border-radius: 4px;
box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.005);
box-sizing: border-box;
color: #b3b3b3;
cursor: pointer;
font-size: 13px;
height: 1em;
line-height: 1em;
margin-top: -4px;
padding: 4px;
padding: 4px 6px;
position: absolute;
right: 0;
top: 0;
z-index: 2;
z-index: 1;
}
.graphical-report__legend__reset:hover {
border-color: #333;
border-color: #999999;
color: #333;
}
.graphical-report__legend__reset.disabled {
display: none;
}
.graphical-report__legend__reset::before {
border: 2px solid #fff;
border-radius: 14px;
content: "";
display: block;
height: calc(100% + 2px);
left: -3px;
position: absolute;
top: -3px;
width: calc(100% + 2px);
z-index: 1;
}
.graphical-report__legend__item {
padding: 10px 20px 8px 40px;
position: relative;
Expand Down
27 changes: 7 additions & 20 deletions build/development/plugins/tauCharts.legend.dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,41 +25,28 @@
font-size: 13px;
}
.graphical-report__legend__reset {
background-color: #000;
background-color: rgba(0, 0, 0, 0.9);
border: 1px solid #606060;
border-radius: 12px;
box-sizing: content-box;
border-radius: 4px;
box-shadow: 0 1px 4px 0 rgba(255, 255, 255, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.005);
box-sizing: border-box;
color: #606060;
cursor: pointer;
font-size: 13px;
height: 1em;
line-height: 1em;
margin-top: -4px;
padding: 4px;
padding: 4px 6px;
position: absolute;
right: 0;
top: 0;
z-index: 2;
z-index: 1;
}
.graphical-report__legend__reset:hover {
border-color: #fff;
border-color: #808080;
color: #fff;
}
.graphical-report__legend__reset.disabled {
display: none;
}
.graphical-report__legend__reset::before {
border: 2px solid #000;
border-radius: 14px;
content: "";
display: block;
height: calc(100% + 2px);
left: -3px;
position: absolute;
top: -3px;
width: calc(100% + 2px);
z-index: 1;
}
.graphical-report__legend__item {
padding: 10px 20px 8px 40px;
position: relative;
Expand Down
27 changes: 7 additions & 20 deletions build/development/plugins/tauCharts.legend.default.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,41 +25,28 @@
font-size: 13px;
}
.graphical-report__legend__reset {
background-color: #fff;
background-color: rgba(255, 255, 255, 0.9);
border: 1px solid #b3b3b3;
border-radius: 12px;
box-sizing: content-box;
border-radius: 4px;
box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.005);
box-sizing: border-box;
color: #b3b3b3;
cursor: pointer;
font-size: 13px;
height: 1em;
line-height: 1em;
margin-top: -4px;
padding: 4px;
padding: 4px 6px;
position: absolute;
right: 0;
top: 0;
z-index: 2;
z-index: 1;
}
.graphical-report__legend__reset:hover {
border-color: #333;
border-color: #999999;
color: #333;
}
.graphical-report__legend__reset.disabled {
display: none;
}
.graphical-report__legend__reset::before {
border: 2px solid #fff;
border-radius: 14px;
content: "";
display: block;
height: calc(100% + 2px);
left: -3px;
position: absolute;
top: -3px;
width: calc(100% + 2px);
z-index: 1;
}
.graphical-report__legend__item {
padding: 10px 20px 8px 40px;
position: relative;
Expand Down
20 changes: 18 additions & 2 deletions build/development/plugins/tauCharts.legend.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
var RESET_SELECTOR = '.graphical-report__legend__reset';
var COLOR_ITEM_SELECTOR = '.graphical-report__legend__item-color';
var COLOR_TOGGLE_SELECTOR = '.graphical-report__legend__guide--color__overlay';
var SIZE_TICKS_COUNT = 4;

var counter = 0;
var getId = function () {
Expand All @@ -31,12 +32,25 @@
return [min].concat(chunks).concat(max);
};

var splitRealValuesEvenly = function (values, count) {
var splitRealValuesEvenly = function (values, count, funcType) {

if (values.length < 3) {
return values.slice(0);
}
if (count < 3) {
return [values[0], values[values.length - 1]];
}

var repeat = function (x) {
return x;
};
var square = function (x) {
return Math.pow(x, 2);
};
var input = (funcType === 'sqrt' ? Math.sqrt : repeat);
var ouput = (funcType === 'sqrt' ? square : repeat);

values = values.map(input);
var result = [values[0]];
var length = (values[values.length - 1] - values[0]);
var halfStep = (0.5 * length / (count - 1));
Expand Down Expand Up @@ -94,6 +108,8 @@

result.push(values[values.length - 1]);

result = result.map(ouput);

return result;
};

Expand Down Expand Up @@ -470,7 +486,7 @@
.sort(function (a, b) {
return (a - b);
});
var steps = splitRealValuesEvenly(realValues, 5);
var steps = splitRealValuesEvenly(realValues, SIZE_TICKS_COUNT, sizeScale.funcType);

values = utils.unique(steps
.map(function (x) {
Expand Down
5 changes: 3 additions & 2 deletions build/development/tauCharts.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! taucharts - v0.10.0-beta.16 - 2017-02-08
/*! taucharts - v0.10.0-beta.17 - 2017-02-08
* https://github.com/TargetProcess/tauCharts
* Copyright (c) 2017 Taucraft Limited; Licensed Apache License 2.0 */
(function webpackUniversalModuleDefinition(root, factory) {
Expand Down Expand Up @@ -348,7 +348,7 @@ return /******/ (function(modules) { // webpackBootstrap
}]));

/* global VERSION:false */
var version = ("0.10.0-beta.16");
var version = ("0.10.0-beta.17");
exports.GPL = _tau.GPL;
exports.Plot = _tau2.Plot;
exports.Chart = _tau3.Chart;
Expand Down Expand Up @@ -16904,6 +16904,7 @@ return /******/ (function(modules) { // webpackBootstrap
_this.vars = [Math.min.apply(Math, _toConsumableArray([min, vars[0]].filter(Number.isFinite))), Math.max.apply(Math, _toConsumableArray([max, vars[1]].filter(Number.isFinite)))];

_this.addField('scaleType', 'size');
_this.addField('funcType', scaleConfig.func || 'sqrt');
return _this;
}

Expand Down
4 changes: 2 additions & 2 deletions build/production/tauCharts.dark.min.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions build/production/tauCharts.default.min.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions build/production/tauCharts.min.css

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions build/production/tauCharts.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "taucharts",
"version": "0.10.0-beta.16",
"version": "0.10.0-beta.17",
"homepage": "https://github.com/TargetProcess/tauCharts",
"description": "D3 based data-focused charting library",
"author": {
Expand Down

0 comments on commit c0441c8

Please sign in to comment.