g-chartframe
Advanced tools
Comparing version 0.3.9 to 0.4.1
@@ -1,1 +0,1 @@ | ||
var version = "0.3.9"; export * from "../index"; export {version}; | ||
var version = "0.4.1"; export * from "../index"; export {version}; |
@@ -34,2 +34,3 @@ (function (global, factory) { | ||
sourcePosition = {x:4}, | ||
sourcePlotYOffset = 30, | ||
sourceStyle={}, | ||
@@ -69,3 +70,3 @@ | ||
if ((p.node()!= undefined) && (p.node().nodeName.toLowerCase() == 'svg')) { | ||
if (p.node().nodeName.toLowerCase() == 'svg') { | ||
p.transition(transition) | ||
@@ -122,5 +123,4 @@ .attr('width', graphicWidth) | ||
//title | ||
p.selectAll('text.chart-title').remove(); | ||
p.selectAll('text.chart-title') | ||
.data([title],identity) | ||
.data([title]) | ||
.enter() | ||
@@ -141,3 +141,3 @@ .append('text') | ||
p.selectAll('text.chart-title tspan') | ||
.html(identity) | ||
.html(function(d){ return d; }) | ||
.transition(transition) | ||
@@ -149,5 +149,4 @@ .attr('y', function(d,i){ return (titlePosition.y + (i * titleLineHeight)); }) | ||
//subtitle | ||
p.selectAll('text.chart-subtitle').remove(); | ||
p.selectAll('text.chart-subtitle') | ||
.data([subtitle], identity) | ||
.data([subtitle]) | ||
.enter() | ||
@@ -158,15 +157,13 @@ .append('text') | ||
subtitleText.selectAll('tspan') | ||
.data(subtitle.split('|'),identity) | ||
.data(subtitle.split('|')) | ||
.enter() | ||
.append('tspan') | ||
.html(identity) | ||
.html(function(d){ return d; }) | ||
.attr('y',function(d,i){ return (subtitlePosition.y + (i * subtitleLineHeight)); }) | ||
.attr('x',subtitlePosition.x) | ||
.call(attributeStyle, subtitleStyle); | ||
subtitleText.selectAll('tspan').exit().remove(); | ||
}); | ||
p.selectAll('text.chart-subtitle tspan') | ||
.html(identity) | ||
.html(function(d){ return d; }) | ||
.transition(transition) | ||
@@ -178,5 +175,4 @@ .attr('y', function(d,i){ return (subtitlePosition.y + (i * subtitleLineHeight)); }) | ||
//source | ||
p.selectAll('text.chart-source').remove(); | ||
p.selectAll('text.chart-source') | ||
.data([source],identity) | ||
.data([source]) | ||
.enter() | ||
@@ -190,3 +186,3 @@ .append('text') | ||
.append('tspan') | ||
.html(identity) | ||
.html(function(d){ return d; }) | ||
.attr('y', function(d,i){ | ||
@@ -196,5 +192,5 @@ if(sourcePosition.y){ | ||
} | ||
return ((graphicHeight - margin.bottom + sourceLineHeight*1.5) + ((i) * sourceLineHeight)); | ||
return ((graphicHeight - (margin.bottom - sourcePlotYOffset) + sourceLineHeight*1.5) + ((i) * sourceLineHeight)); | ||
}) | ||
.attr('x',sourcePosition.x) | ||
.attr('x',subtitlePosition.x) | ||
.call(attributeStyle, subtitleStyle); | ||
@@ -210,3 +206,3 @@ }); | ||
} | ||
return ((graphicHeight - margin.bottom + sourceLineHeight*1.5) + ((i) * sourceLineHeight)); | ||
return ((graphicHeight - (margin.bottom - sourcePlotYOffset) + sourceLineHeight*1.5) + ((i) * sourceLineHeight)); | ||
}) | ||
@@ -308,2 +304,8 @@ .attr('x', sourcePosition.x) | ||
frame.sourcePlotYOffset = function(x){ | ||
if(x == undefined) return sourcePlotYOffset; | ||
sourcePlotYOffset = x; | ||
return frame; | ||
}; | ||
frame.sourceStyle = function(x){ | ||
@@ -484,3 +486,3 @@ if(x == undefined) return sourceStyle; | ||
.watermarkOffset(-28) | ||
.margin({bottom:50, right:20}) | ||
.margin({bottom:80, right:20}) | ||
.rem(18) | ||
@@ -516,3 +518,3 @@ .titleStyle({ | ||
.height(68) | ||
.margin({top:40, left:7, bottom:27, right:7}) | ||
.margin({top:40, left:7, bottom:35, right:7}) | ||
.watermark(watermarkPathDark) | ||
@@ -545,2 +547,3 @@ .rem(12) | ||
.sourceX(7) | ||
.sourcePlotYOffset(10) | ||
.sourceLineHeight(8) | ||
@@ -561,3 +564,3 @@ .watermark(''); | ||
.watermarkOffset(25) | ||
.margin({left:50, right:40, bottom:88, top:140}) | ||
.margin({left:50, right:40, bottom:128, top:140}) | ||
.rem(28) | ||
@@ -602,3 +605,3 @@ .titleX(50) | ||
.watermark('') | ||
.margin({left:207, right:207, bottom:150, top:233}) | ||
.margin({left:207, right:207, bottom:210, top:233}) | ||
.rem(48) | ||
@@ -624,2 +627,3 @@ .titleX(207) | ||
.sourceX(207) | ||
.sourcePlotYOffset(50) | ||
.sourceLineHeight(38) | ||
@@ -638,6 +642,4 @@ .sourceStyle({ | ||
function identity(d){ return d; } | ||
var version = "0.4.1"; | ||
var version = "0.3.9"; | ||
exports.version = version; | ||
@@ -644,0 +646,0 @@ exports.frame = chartFrame; |
{ | ||
"name": "g-chartframe", | ||
"version": "0.3.9", | ||
"version": "0.4.1", | ||
"description": "FT styled frames for D3 graphics", | ||
"license": "ISC", | ||
"jsnext:main":"index.js", | ||
"jsnext:main": "index.js", | ||
"main": "build/g-chartframe.js", | ||
@@ -34,4 +34,3 @@ "keywords": [ | ||
}, | ||
"dependencies": { | ||
} | ||
"dependencies": {} | ||
} |
@@ -29,2 +29,3 @@ | ||
sourcePosition = {x:4}, | ||
sourcePlotYOffset = 30, | ||
sourceStyle={}, | ||
@@ -64,3 +65,3 @@ | ||
if ((p.node()!= undefined) && (p.node().nodeName.toLowerCase() == 'svg')) { | ||
if (p.node().nodeName.toLowerCase() == 'svg') { | ||
p.transition(transition) | ||
@@ -117,5 +118,4 @@ .attr('width', graphicWidth) | ||
//title | ||
p.selectAll('text.chart-title').remove(); | ||
p.selectAll('text.chart-title') | ||
.data([title],identity) | ||
.data([title]) | ||
.enter() | ||
@@ -136,3 +136,3 @@ .append('text') | ||
p.selectAll('text.chart-title tspan') | ||
.html(identity) | ||
.html(function(d){ return d; }) | ||
.transition(transition) | ||
@@ -144,5 +144,4 @@ .attr('y', function(d,i){ return (titlePosition.y + (i * titleLineHeight)); }) | ||
//subtitle | ||
p.selectAll('text.chart-subtitle').remove(); | ||
p.selectAll('text.chart-subtitle') | ||
.data([subtitle], identity) | ||
.data([subtitle]) | ||
.enter() | ||
@@ -153,15 +152,13 @@ .append('text') | ||
subtitleText.selectAll('tspan') | ||
.data(subtitle.split('|'),identity) | ||
.data(subtitle.split('|')) | ||
.enter() | ||
.append('tspan') | ||
.html(identity) | ||
.html(function(d){ return d; }) | ||
.attr('y',function(d,i){ return (subtitlePosition.y + (i * subtitleLineHeight)); }) | ||
.attr('x',subtitlePosition.x) | ||
.call(attributeStyle, subtitleStyle); | ||
subtitleText.selectAll('tspan').exit().remove(); | ||
}); | ||
p.selectAll('text.chart-subtitle tspan') | ||
.html(identity) | ||
.html(function(d){ return d; }) | ||
.transition(transition) | ||
@@ -173,5 +170,4 @@ .attr('y', function(d,i){ return (subtitlePosition.y + (i * subtitleLineHeight)); }) | ||
//source | ||
p.selectAll('text.chart-source').remove(); | ||
p.selectAll('text.chart-source') | ||
.data([source],identity) | ||
.data([source]) | ||
.enter() | ||
@@ -185,3 +181,3 @@ .append('text') | ||
.append('tspan') | ||
.html(identity) | ||
.html(function(d){ return d; }) | ||
.attr('y', function(d,i){ | ||
@@ -191,5 +187,5 @@ if(sourcePosition.y){ | ||
} | ||
return ((graphicHeight - margin.bottom + sourceLineHeight*1.5) + ((i) * sourceLineHeight)); | ||
return ((graphicHeight - (margin.bottom - sourcePlotYOffset) + sourceLineHeight*1.5) + ((i) * sourceLineHeight)); | ||
}) | ||
.attr('x',sourcePosition.x) | ||
.attr('x',subtitlePosition.x) | ||
.call(attributeStyle, subtitleStyle); | ||
@@ -205,3 +201,3 @@ }); | ||
} | ||
return ((graphicHeight - margin.bottom + sourceLineHeight*1.5) + ((i) * sourceLineHeight)); | ||
return ((graphicHeight - (margin.bottom - sourcePlotYOffset) + sourceLineHeight*1.5) + ((i) * sourceLineHeight)); | ||
}) | ||
@@ -303,2 +299,8 @@ .attr('x', sourcePosition.x) | ||
frame.sourcePlotYOffset = function(x){ | ||
if(x == undefined) return sourcePlotYOffset; | ||
sourcePlotYOffset = x; | ||
return frame; | ||
}; | ||
frame.sourceStyle = function(x){ | ||
@@ -479,3 +481,3 @@ if(x == undefined) return sourceStyle; | ||
.watermarkOffset(-28) | ||
.margin({bottom:50, right:20}) | ||
.margin({bottom:80, right:20}) | ||
.rem(18) | ||
@@ -511,3 +513,3 @@ .titleStyle({ | ||
.height(68) | ||
.margin({top:40, left:7, bottom:27, right:7}) | ||
.margin({top:40, left:7, bottom:35, right:7}) | ||
.watermark(watermarkPathDark) | ||
@@ -540,2 +542,3 @@ .rem(12) | ||
.sourceX(7) | ||
.sourcePlotYOffset(10) | ||
.sourceLineHeight(8) | ||
@@ -556,3 +559,3 @@ .watermark(''); | ||
.watermarkOffset(25) | ||
.margin({left:50, right:40, bottom:88, top:140}) | ||
.margin({left:50, right:40, bottom:128, top:140}) | ||
.rem(28) | ||
@@ -597,3 +600,3 @@ .titleX(50) | ||
.watermark('') | ||
.margin({left:207, right:207, bottom:150, top:233}) | ||
.margin({left:207, right:207, bottom:210, top:233}) | ||
.rem(48) | ||
@@ -619,2 +622,3 @@ .titleX(207) | ||
.sourceX(207) | ||
.sourcePlotYOffset(50) | ||
.sourceLineHeight(38) | ||
@@ -633,4 +637,2 @@ .sourceStyle({ | ||
function identity(d){ return d; } | ||
export { chartFrame as frame }; | ||
@@ -637,0 +639,0 @@ export { webFrame as webFrame }; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1134
242725
12