-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Remove dependencies on Plotly for Choropleth #165
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 all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,13 +13,16 @@ var Plotly = require('../../plotly'); | |
var d3 = require('d3'); | ||
|
||
var Color = require('../../components/color'); | ||
var Drawing = require('../../components/drawing'); | ||
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. Same thing with Drawing. |
||
|
||
var getColorscale = require('../../components/colorscale/get_scale'); | ||
var makeScaleFunction = require('../../components/colorscale/make_scale_function'); | ||
var getTopojsonFeatures = require('../../lib/topojson_utils').getTopojsonFeatures; | ||
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.
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. Mainly because I initially grouped all the components pieces together, then when I added 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. 👍 |
||
var locationToFeature = require('../../lib/geo_location_utils').locationToFeature; | ||
var arrayToCalcItem = require('../../lib/array_to_calc_item'); | ||
var getColorscale = require('../../components/colorscale/get_scale'); | ||
var makeScaleFunction = require('../../components/colorscale/make_scale_function'); | ||
|
||
var constants = require('../../constants/geo_constants'); | ||
var attributes = require('./attributes'); | ||
|
||
var plotChoropleth = module.exports = {}; | ||
|
||
|
@@ -141,7 +144,7 @@ plotChoropleth.style = function(geo) { | |
d3.select(this) | ||
.attr('fill', function(d) { return sclFunc(d.z); }) | ||
.call(Color.stroke, d.mlc || markerLine.color) | ||
.call(Plotly.Drawing.dashLine, '', d.mlw || markerLine.width); | ||
.call(Drawing.dashLine, '', d.mlw || markerLine.width); | ||
}); | ||
}); | ||
}; | ||
|
@@ -157,7 +160,7 @@ function makeCleanHoverLabelsFunc(geo, trace) { | |
} | ||
|
||
var hoverinfoParts = (hoverinfo === 'all') ? | ||
Plotly.Choropleth.attributes.hoverinfo.flags : | ||
attributes.hoverinfo.flags : | ||
hoverinfo.split('+'); | ||
|
||
var hasName = (hoverinfoParts.indexOf('name') !== -1), | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,7 @@ | |
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
|
||
var Plotly = require('../../plotly'); | ||
var Drawing = require('../../components/drawing'); | ||
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. This file is a dependency of the choropleth attributes file so it needed to be changed as well. |
||
|
||
var PTS_LINESONLY = 20; // TODO put in constants/ | ||
|
||
|
@@ -166,7 +165,7 @@ module.exports = { | |
marker: { | ||
symbol: { | ||
valType: 'enumerated', | ||
values: Plotly.Drawing.symbolList, | ||
values: Drawing.symbolList, | ||
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. @mdtusz does the symbol list generate properly? To check: var schema = Plotly.PlotSchema.get();
console.log(schema.traces.scatter.attributes.marker.symbols.values); 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. Looks like they're all there. For any future readers though, it's var schema = Plotly.PlotSchema.get();
console.log(schema.traces.scatter.attributes.marker.symbol.values); Singular |
||
dflt: 'circle', | ||
arrayOk: true, | ||
role: 'style', | ||
|
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.
Plots
can stand on its own now so we should change things to directly require it whenever we come acrossPlotly.Plots
.