Scatterplot + Legend Symbols on IE
Pre-release
Pre-release
v0.51.0
Good afternoon,
Since non-scaling-stroke
does not work on Internet Explorer, we had to change our approach to drawing symbols. A SymbolFactory
now draws a particular symbol given a size; see below for what changes this causes to the API.
Bugfixes
- Stroke-width can now be set on symbols in Internet Explorer. Demo here: http://jsfiddle.net/ghcejh4z/
API-Breaking Changes
- The
SymbolGenerators
module has been renamed toSymbolFactories
- A
SymbolFactory
is now a function with the following signature:
(symbolSize: number) => string
where symbolSize is the edge-length of a square drawn as a tight bound around the symbol.
Legend
ssymbolGenerator
API has been reworked intosymbolFactoryAccessor
which takes in an accessor function that returns aSymbolFactory
. It has the following signature:
public symbolFactoryAccessor((datum: any, index: number) => SymbolFactory)
This allows selection of the SymbolFactory
to use based on the Legend
entry.
Upgrade Instructions
- Instead of using the
d3Symbol
SymbolFactory, one of the following endpoints should be used instead:
Plottable.SymbolFactories.square();
Plottable.SymbolFactories.circle();
Plottable.SymbolFactories.diamond();
Plottable.SymbolFactories.cross();
Plottable.SymbolFactories.triangleUp();
Plottable.SymbolFactories.triangleDown();
project()
calls for symbols have to be adjusted:
var squareGenerator = Plottable.SymbolFactories.square();
scatterplot.project("symbol", function(d, i) { return squareGenerator; });
- To set the size of points on
Plot.Scatter
,project()
on "size" instead of "r":
// before: project("r", 3);
scatterplot.project("size", 6); // size of square containing symbol, instead of radius of symbol
Release Song
Gold Rays -- Vinyl Pinups
https://www.youtube.com/watch?v=Izl8zFCWSjA