Skip to content

Commit 7c7baf5

Browse files
committed
bringing up to date with master for #207
2 parents 25c0d36 + 52b3de2 commit 7c7baf5

40 files changed

+844
-565
lines changed

dist/css/core.css

Lines changed: 59 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -529,9 +529,6 @@ span.step-number {
529529
.data-input.dropping .file-drop {
530530
z-index: 2;
531531
}
532-
.data-input .cb-alert {
533-
font-size: 1.2em;
534-
}
535532
.series-control {
536533
margin: 0 0 10px 0;
537534
}
@@ -565,6 +562,14 @@ span.step-number {
565562
font-size: 16px;
566563
line-height: 24px;
567564
}
565+
@media screen and (max-width: $single_column_breakpoint) {
566+
.series-control .axis-color {
567+
-webkit-flex-direction: row;
568+
-ms-flex-direction: row;
569+
flex-direction: row;
570+
width: 100%;
571+
}
572+
}
568573
.series-label {
569574
margin: 10px 0;
570575
}
@@ -589,6 +594,11 @@ span.step-number {
589594
float: left;
590595
margin-right: 4px;
591596
}
597+
@media screen and (max-width: $single_column_breakpoint) {
598+
.series-label-input.cb-text-input {
599+
width: 100%;
600+
}
601+
}
592602
.cb-text-input {
593603
width: 100%;
594604
}
@@ -620,6 +630,14 @@ span.step-number {
620630
padding-left: 0px;
621631
width: calc(100% - 55px);
622632
}
633+
@media screen and (max-width: $single_column_breakpoint) {
634+
.axissection,
635+
.colorsection {
636+
width: 100%;
637+
margin-bottom: 5px;
638+
margin-top: 10px;
639+
}
640+
}
623641
.typesection {
624642
width: 100%;
625643
}
@@ -678,6 +696,18 @@ span.step-number {
678696
.scale-tangle-inputs .cb-labelled-tangle .cb-tangle {
679697
margin-left: 5px;
680698
}
699+
@media screen and (max-width: $single_column_breakpoint) {
700+
.scale-tangle-inputs {
701+
display: block;
702+
padding-bottom: 10px;
703+
}
704+
.scale-tangle-inputs .cb-labelled-tangle {
705+
display: block;
706+
}
707+
.scale-tangle-inputs .cb-labelled-tangle label {
708+
width: 5em;
709+
}
710+
}
681711
.editor-label {
682712
font-size: 18px;
683713
font-family: 'Khula-Regular', Arial, Helvetica, sans-serif;
@@ -725,6 +755,14 @@ span.step-number {
725755
line-height: 24px;
726756
color: #bebebe;
727757
}
758+
@media screen and (max-width: $single_column_breakpoint) {
759+
.chartgrid-editor .series-control .colorsection {
760+
width: 100%;
761+
}
762+
}
763+
.chartgrid-editor .editor-options h2 {
764+
width: 80%;
765+
}
728766
.chartgrid-editor .grid-options {
729767
display: table;
730768
border-collapse: separate;
@@ -749,9 +787,15 @@ span.step-number {
749787
.chartgrid-editor .series-label-input {
750788
width: 80%;
751789
}
790+
@media screen and (max-width: $single_column_breakpoint) {
791+
.chartgrid-editor .series-label-input.cb-text-input {
792+
width: 100%;
793+
}
794+
}
752795
.chartgrid-editor .universal-toggle {
753796
display: block;
754-
width: 98%;
797+
width: auto;
798+
margin-bottom: 2em;
755799
}
756800
.mobile-overrides> h2:first-child {
757801
font-family: "Khula-Bold", Arial, sans-serif;
@@ -796,6 +840,12 @@ svg.renderer-svg tspan {
796840
.d4 {
797841
font-size: 20px;
798842
}
843+
.d4 .leftAxis path.domain {
844+
display: none;
845+
}
846+
.d4 .xAxis path.domain {
847+
display: none;
848+
}
799849
.d4 .axis .tick {
800850
font-family: 'Khula-Light', Arial, Helvetica, sans-serif;
801851
}
@@ -835,6 +885,9 @@ svg.renderer-svg tspan {
835885
.d4 .axis[data-scale="time"] .tick:first-child text {
836886
text-anchor: start;
837887
}
888+
.d4 .xAxislabel {
889+
fill: #666;
890+
}
838891
.d4 .concealer-label {
839892
font-family: 'Khula-Light', Arial, Helvetica, sans-serif;
840893
}
@@ -914,6 +967,8 @@ svg.renderer-svg tspan {
914967
.svg-label-text {
915968
font-size: 20px;
916969
font-family: 'Khula-Light', Arial, Helvetica, sans-serif;
970+
}
971+
.svg-label-text.draggable {
917972
cursor: move;
918973
}
919974
.crosshair line {

gulpfile.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ var uglify = require("gulp-uglify");
2121

2222
// local modules
2323
var config = require("./gulp/config");
24+
var gutil = require("gulp-util")
2425

2526
gulp.task("stylus", function () {
2627
return gulp.src(config.paths.src.styl + "/main.styl")
@@ -83,7 +84,7 @@ gulp.task("browserify:prod", function () {
8384
return bundler.bundle()
8485
.pipe(source("main.js"))
8586
.pipe(buffer())
86-
.pipe(uglify())
87+
.pipe(uglify().on("error", gutil.log))
8788
.pipe(gulp.dest(config.paths.build.js));
8889
});
8990

package.json

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "chartbuilder",
3-
"version": "2.6.0",
3+
"version": "2.6.4",
44
"description": "Easily create beautiful charts",
55
"main": "src/js/index.js",
66
"scripts": {
@@ -11,7 +11,9 @@
1111
"test-page": "gulp test-page",
1212
"dev": "gulp",
1313
"build": "gulp build",
14-
"gh-pages": "npm run build && npm run docs && mv api-docs build && gulp gh-pages"
14+
"gh-pages": "npm run build && npm run docs && mv api-docs build && gulp gh-pages",
15+
"version": "npm run build && git add -A dist",
16+
"postversion": "npm run gh-pages"
1517
},
1618
"repository": {
1719
"type": "git",
@@ -47,19 +49,19 @@
4749
],
4850
"license": "MIT",
4951
"dependencies": {
50-
"chartbuilder-ui": "^1.3.0",
52+
"chartbuilder-ui": "~1.5.4",
5153
"classnames": "^2.2.1",
5254
"d3": "^3.5.5",
5355
"d4": "git://github.com/yanofsky/d4.git",
5456
"flux": "~2.1.1",
5557
"lodash": "^4.0.0",
56-
"markdown": "^0.5.0",
57-
"react": "^0.14.5",
58-
"react-addons-pure-render-mixin": "^0.14.5",
59-
"react-addons-shallow-compare": "^0.14.5",
60-
"react-addons-update": "^0.14.5",
61-
"react-dom": "^0.14.5",
62-
"save-svg-as-png": "^1.0.2",
58+
"markdown-it": "^6.0.0",
59+
"react": "^0.14.7",
60+
"react-addons-pure-render-mixin": "^0.14.7",
61+
"react-addons-shallow-compare": "^0.14.7",
62+
"react-addons-update": "^0.14.7",
63+
"react-dom": "^0.14.7",
64+
"save-svg-as-png": "git://github.com/nsonnad/saveSvgAsPng.git#clean-svg-fonts",
6365
"sizeof": "^1.0.0",
6466
"sugar-date": "^1.5.1"
6567
},
@@ -77,9 +79,10 @@
7779
"gulp-gh-pages": "^0.5.4",
7880
"gulp-stylus": "^2.0.1",
7981
"gulp-uglify": "^1.1.0",
82+
"gulp-util": "^3.0.7",
8083
"nib": "^1.0.2",
8184
"nomnom": "^1.8.0",
82-
"react-addons-test-utils": "^0.14.5",
85+
"react-addons-test-utils": "^0.14.7",
8386
"reactify": "^1.1.1",
8487
"rewireify": "^0.2.5",
8588
"smokestack": "^3.4.1",

src/htdocs/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width" />
66
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
7-
<title>Chartbuilder 2.0</title>
7+
<title>Chartbuilder 2.6.4</title>
88
<link rel="stylesheet" href="css/main.css">
99
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
1010
</head>
1111
<body>
1212
<div class="header">
13-
<h1>Chartbuilder 2.0</h1>
13+
<h1>Chartbuilder 2.6.4</h1>
1414
</div>
1515
<div class="chartbuilder-container">
1616
</div>

src/js/charts/cb-chart-grid/chart-grid-config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ var defaultProps = {
8888
},
8989
dateSettings: {
9090
dateFrequency: "auto",
91-
dateFormat: "auto"
91+
dateFormat: "auto",
92+
inputTZ: null,
93+
displayTZ: "as-entered"
9294
},
9395
numericSettings: {
9496
ticks: null,

src/js/charts/cb-chart-grid/parse-chart-grid.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ var map = require("lodash/map");
33
var assign = require("lodash/assign");
44
var each = require("lodash/each");
55

6+
var SessionStore = require("../../stores/SessionStore");
67
var dataBySeries = require("../../util/parse-data-by-series");
78
var help = require("../../util/helper");
89

@@ -25,7 +26,10 @@ function parseChartgrid(config, _chartProps, callback, parseOpts) {
2526
parseOpts = parseOpts || {};
2627
// dont check for date column if grid type is bar
2728
var checkForDate = chartProps._grid.type !== "bar";
28-
var bySeries = dataBySeries(chartProps.input.raw, { checkForDate: checkForDate, type: chartProps.input.type});
29+
var bySeries = dataBySeries(chartProps.input.raw, {
30+
checkForDate: checkForDate,
31+
type: chartProps.input.type
32+
});
2933

3034
var gridSettings = {
3135
rows: +chartProps._grid.rows || chartgrid_defaults._grid.rows,
@@ -60,6 +64,7 @@ function parseChartgrid(config, _chartProps, callback, parseOpts) {
6064

6165
if (bySeries.hasDate) {
6266
chartProps.scale.dateSettings = chartProps.scale.dateSettings || clone(config.defaultProps.chartProps.scale.dateSettings);
67+
chartProps.scale.dateSettings.inputTZ = chartProps.scale.dateSettings.inputTZ || SessionStore.get("nowOffset")
6368
// for dates, default type should be line
6469
gridSettings.type = _chartProps._grid.type || "line";
6570
isColumnOrBar = (gridSettings.type === "column" || gridSettings.type === "bar");
@@ -72,7 +77,7 @@ function parseChartgrid(config, _chartProps, callback, parseOpts) {
7277
var maxPrecision = 5;
7378
var factor = Math.pow(10, maxPrecision);
7479
gridSettings.type = _chartProps._grid.type || "line";
75-
80+
7681
_computed = {
7782
//TODO look at entries for all series not just the first
7883
data: bySeries.series[0].values.map(function(d){return +d.entry}),
@@ -119,7 +124,7 @@ function parseChartgrid(config, _chartProps, callback, parseOpts) {
119124
}
120125
});
121126
}
122-
chartProps.mobile.scale.numericSettings = currMobile
127+
chartProps.mobile.scale.numericSettings = currMobile
123128
}
124129
} else {
125130
chartProps.mobile = {};

src/js/charts/cb-xy/parse-xy.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ var filter = require("lodash/filter");
66

77
var dataBySeries = require("../../util/parse-data-by-series");
88
var help = require("../../util/helper");
9+
var SessionStore = require("../../stores/SessionStore");
910

1011
var scaleNames = ["primaryScale", "secondaryScale"];
1112

@@ -22,8 +23,11 @@ function parseXY(config, _chartProps, callback, parseOpts) {
2223
// clone so that we aren't modifying original
2324
// this can probably be avoided by applying new settings differently
2425
var chartProps = JSON.parse(JSON.stringify(_chartProps));
26+
var bySeries = dataBySeries(chartProps.input.raw, {
27+
checkForDate: true,
28+
type: chartProps.input.type
29+
});
2530

26-
var bySeries = dataBySeries(chartProps.input.raw, { checkForDate: true, type: chartProps.input.type });
2731
var labels = chartProps._annotations.labels;
2832
var allColumn = true;
2933
// check if either scale contains columns, as we'll need to zero the axis
@@ -177,6 +181,7 @@ function parseXY(config, _chartProps, callback, parseOpts) {
177181
if (bySeries.hasDate) {
178182
scale.hasDate = bySeries.hasDate;
179183
scale.dateSettings = chartProps.scale.dateSettings || clone(config.defaultProps.chartProps.scale.dateSettings);
184+
scale.dateSettings.inputTZ = scale.dateSettings.inputTZ || SessionStore.get("nowOffset")
180185
}
181186

182187
if (bySeries.isNumeric) {

src/js/charts/cb-xy/xy-config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
var ChartConfig = require("../ChartConfig");
2+
var now = new Date();
23

34
/**
45
* ### Configuration of an XY chart
@@ -30,6 +31,7 @@ var ChartConfig = require("../ChartConfig");
3031
* @property {object} margin - Distances btwn outer chart elements and container
3132
* @property {object} padding - Distances btwn inner chart elements and container
3233
*/
34+
3335
var display = {
3436
labelRectSize: "0.6em",
3537
labelXMargin: "0.6em",
@@ -95,7 +97,9 @@ var defaultProps = {
9597
},
9698
dateSettings: {
9799
dateFrequency: "auto",
98-
dateFormat: "auto"
100+
dateFormat: "auto",
101+
inputTZ: null,
102+
displayTZ: "as-entered"
99103
},
100104
numericSettings: {
101105
ticks: null,

0 commit comments

Comments
 (0)