-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Ternary phase diagrams #390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
811c874
2595731
7e7e217
6b4af04
5cd86fc
aee10b6
330574b
2769e9c
1b9f43e
4595ac6
3ccc3ea
9ec6d8f
abdce19
c2f7f71
f3e3f1e
3f99890
dc5cb63
f43fe64
c79d993
7dbd964
c24e444
381de10
c47d4f9
17df3cd
637a956
0857b44
c75051d
e78818d
07e8502
c9ee322
c88083c
0087ab8
9dd02ee
ee28402
515e121
cdc6195
793afb3
c582d7f
54cbb2f
a0e0cbd
4eb83fb
e08dce9
a5d5969
408e3b0
dae00af
a15e9b6
042cf3a
f7b2447
3974d11
f9bb22e
06565e0
670dc0d
aae3e47
fbd0a0b
8cc59a9
e4e1019
e3c0dd8
324446d
6a00fc2
8338be6
dfcd6c3
b37439e
e0c29f1
ffa9d42
11e533b
f7d9c66
e99a5a6
eae47bb
277c8f8
6e38cca
6cefff0
6465c6c
e033d08
a043655
9d3776e
ab22ef9
c3ab79f
6f8d468
fce4d68
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,12 +10,17 @@ | |
'use strict'; | ||
|
||
var Lib = require('../../../lib'); | ||
var Color = require('../../../components/color'); | ||
|
||
var layoutAttributes = require('./axis_attributes'); | ||
var handleAxisDefaults = require('../../cartesian/axis_defaults'); | ||
|
||
var axesNames = ['xaxis', 'yaxis', 'zaxis']; | ||
var noop = function() {}; | ||
|
||
// TODO: hard-coded lightness fraction based on gridline default colors | ||
// that differ from other subplot types. | ||
var gridLightness = (204 - 0x44) / (255 - 0x44); | ||
|
||
module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, options) { | ||
var containerIn, containerOut; | ||
|
@@ -40,21 +45,25 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, options) { | |
font: options.font, | ||
letter: axName[0], | ||
data: options.data, | ||
showGrid: true | ||
showGrid: true, | ||
bgColor: options.bgColorCombined | ||
}); | ||
|
||
coerce('gridcolor'); | ||
coerce('gridcolor', Color.lightColor(containerOut.color, options.bgColorCombined, gridLightness)); | ||
coerce('title', axName[0]); // shouldn't this be on-par with 2D? | ||
|
||
containerOut.setScale = noop; | ||
|
||
if(coerce('showspikes')) { | ||
coerce('spikesides'); | ||
coerce('spikethickness'); | ||
coerce('spikecolor'); | ||
// TODO: this makes the default spikes #444 rather than | ||
// #000, is that OK? | ||
coerce('spikecolor', containerOut.color); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fine by me. 👍 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good. I'll take that note out then. If it wasn't clear, the reason for this change is so |
||
} | ||
if(coerce('showbackground')) coerce('backgroundcolor'); | ||
|
||
coerce('showaxeslabels'); | ||
// TODO: relate backgroundcolor to common containerOut.color? | ||
if(coerce('showbackground')) coerce('backgroundcolor'); | ||
} | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ describe('Test Gl3dAxes', function() { | |
'showspikes': true, | ||
'spikesides': true, | ||
'spikethickness': 2, | ||
'spikecolor': 'rgb(0,0,0)', | ||
'spikecolor': '#444', | ||
'showbackground': false, | ||
'showaxeslabels': true | ||
}, | ||
|
@@ -42,7 +42,7 @@ describe('Test Gl3dAxes', function() { | |
'showspikes': true, | ||
'spikesides': true, | ||
'spikethickness': 2, | ||
'spikecolor': 'rgb(0,0,0)', | ||
'spikecolor': '#444', | ||
'showbackground': false, | ||
'showaxeslabels': true | ||
}, | ||
|
@@ -54,7 +54,7 @@ describe('Test Gl3dAxes', function() { | |
'showspikes': true, | ||
'spikesides': true, | ||
'spikethickness': 2, | ||
'spikecolor': 'rgb(0,0,0)', | ||
'spikecolor': '#444', | ||
'showbackground': false, | ||
'showaxeslabels': true | ||
} | ||
|
@@ -64,14 +64,17 @@ describe('Test Gl3dAxes', function() { | |
var keys = Object.keys(validObject); | ||
for(var i = 0; i < keys.length; i++) { | ||
var k = keys[i]; | ||
if(validObject[k] !== testObject[k]) return false; | ||
expect(validObject[k]).toBe(testObject[k]); | ||
// if(validObject[k] !== testObject[k]) return false; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. uncomment. |
||
} | ||
return true; | ||
} | ||
|
||
supplyLayoutDefaults(layoutIn, layoutOut, options); | ||
['xaxis', 'yaxis', 'zaxis'].forEach(function(axis) { | ||
expect(checkKeys(expected[axis], layoutOut[axis])).toBe(true); | ||
// expect( | ||
checkKeys(expected[axis], layoutOut[axis]); | ||
// ).toBe(true); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. uncomment this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't it more useful this way? ie I should delete the commented code, but as amended you get a better failure message. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah I see. I thought the whole block was commented. My bad. Ignore ⏫ . |
||
}); | ||
}); | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we already have
tinycolor
as a dependency, why not usetinycolor.mix
?https://github.com/bgrins/TinyColor#color-utilities
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah cool, didn't know about
tinycolor.mix
. I'll put it in.