Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.attr('height', h * 2)
.call(zoom)
// Create clip path for entire chart area
svg
.append('clipPath')
.attr('id', 'entire-chart-area')
.append('rect')
.attr('x', padding.left)
.attr('y', padding.top)
.attr('width', w - padding.left - padding.right)
.attr('height', h * 2 - padding.top - padding.bottom)
.attr('fill', 'none')
// Setup brush domain background texture
const bgTexture = textures
.lines()
.stroke('#ddd')
.size(5)
.strokeWidth(1)
svg.call(bgTexture)
// Create brush domain background
const brushDomainBgContainer = svg.append('g')
const brushDomainBgMask = brushDomainBgContainer
.append('clipPath')
.attr('id', 'brush-domain-bg-area')
.append('rect')
.attr('x', padding.left)
.attr('y', padding.top)
if (url) {
xText
.style('cursor', 'pointer')
.on('click', () => {
window.open(url, '_blank')
})
}
// Setup reverse axis (over onset offset)
// Clone of axis above onset panel, without text
this.selection.append('g')
.attr('class', 'axis axis-x-ticks')
.attr('transform', `translate(0, ${layout.height})`)
// Create onset panel
let onsetTexture = textures.lines()
.lighter()
.strokeWidth(0.5)
.size(8)
.stroke('#ccc')
this.selection.call(onsetTexture)
this.selection.append('rect')
.attr('class', 'onset-texture')
.attr('height', layout.totalHeight - layout.height)
.attr('width', layout.width)
.attr('x', 0)
.attr('y', layout.height)
.style('fill', onsetTexture.url())
this.layout = layout
}
this.svg = svg
this.xScale = xScale
this.yScale = yScale
this.xScaleDate = xScaleDate
this.height = height
this.width = width
this.onsetHeight = onsetHeight
this.weekHook = weekHook
// Add axes
this.setupAxes()
// Add marker primitives
this.timerect = new marker.TimeRect(this)
this.onsetTexture = textures.lines()
.lighter()
.strokeWidth(0.5)
.size(8)
.stroke('#ccc')
svg.call(this.onsetTexture)
// Paint the onset panel
this.paintOnsetOffset()
// Add overlays and other mouse interaction items
this.setupOverlay()
// Axis at top of onset panel
this.setupReverseAxis()
this.history = new marker.HistoricalLines(this)
defaultFill: '#ccc'
},
geographyConfig: {
highlightOnHover: false,
popupOnHover: false
}
})
this.tooltip = d3.select('#choropleth-tooltip')
.style('display', 'none')
let svg = d3.select('#' + elementId + ' svg')
.attr('height', divHeight)
.attr('width', divWidth)
this.selectedTexture = textures.lines()
.size(10)
.background('white')
svg.call(this.selectedTexture)
// Override datamaps css
d3.select('#' + this.selectedTexture.id() + ' path')
.style('stroke-width', '1px')
this.width = svg.node().getBoundingClientRect().width
this.height = svg.node().getBoundingClientRect().height
this.svg = svg
this.regionHook = regionHook
}
generate() {
const t = textures.lines();
[
'size',
'strokeWidth',
'orientation',
'shapeRendering',
'stroke',
'background',
'id',
].forEach((key) => {
if (this.props[key]) t[key](this.props[key]);
});
const selection = new Selection();
t(selection);
this.setState({
pattern: selection.toReact(this.props.components),
.stroke(d3.rgb(c).brighter(0.6))
.background(c)
.lighter()
.thicker();
break;
case 3:
t = textures
.paths()
.d('waves')
.thicker()
.strokeWidth(1)
.stroke(d3.rgb(c).brighter(0.6))
.background(c);
break;
case 4:
t = textures
.lines()
.strokeWidth(1)
.thicker()
.orientation('6/8')
.stroke(d3.rgb(c).brighter(0.6))
.background(c);
break;
default:
t = textures
.circles()
.radius(3)
.fill('transparent')
.strokeWidth(1)
.stroke(d3.rgb(c).brighter(0.6))
.background(c);
break;
colors.forEach((c, i) => {
let t;
switch (i) {
case 0:
t = textures
.lines()
.thicker()
.strokeWidth(1)
.stroke(d3.rgb(c).brighter(0.6))
.background(c);
break;
case 1:
t = textures
.circles()
.fill(d3.rgb(c).brighter(0.6))
.thicker()
.background(c);
break;
case 2:
t = textures
.paths()