Commit a2ba3267 authored by Elango Bharathi's avatar Elango Bharathi Committed by Elango Dhandapani
Browse files

x, y position of svg

parent 66eea01c
Pipeline #46719 passed with stage
in 2 minutes and 5 seconds
......@@ -89,11 +89,16 @@ function sanddance(attrs, options) {
var filter = options.filter
var x = options.x
var y = options.y
var x_pos = options.x_pos
var y_pos = options.y_pos
var result = function (selection) {
dispatch.call('init', selection)
var filtered = filter ? selection.filter(filter) : selection
if (x_pos || y_pos)
d3.select(selection.node().parentNode).attr('transform', 'translate(' + x_pos + ',' + y_pos + ')')
var transition = filtered.transition()
.ease(easing)
......
......@@ -77,13 +77,34 @@
}, {
layout: 'grid',
data: data,
width: width - 20,
height: height - 20,
width: 200,
height: 200,
x_pos: 0,
y_pos: 0,
delay: 500,
duration: 500,
duration: 3000,
count: count,
}).on('init', function () {
doc('Grid for all elements - position at 0, 0 with 200 x 200')
}),
g1.sanddance({
fill: {
metric: 'age',
scheme: 'RdYlGn'
}
}, {
layout: 'grid',
data: data,
width: 100,
height: 100,
x_pos: 100,
y_pos: 100,
delay: 500,
duration: 3000,
count: count,
}).on('init', function () {
doc('Grid for all elements - Fill by age')
doc('Grid for all elements - position at 100, 100 with 100 x 100')
}),
g1.sanddance({}, {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment