Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cto
g1
Commits
a2ba3267
Commit
a2ba3267
authored
Apr 25, 2018
by
Elango Bharathi
Committed by
Elango Dhandapani
Apr 25, 2018
Browse files
x, y position of svg
parent
66eea01c
Pipeline
#46719
passed with stage
in 2 minutes and 5 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/sanddance.js
View file @
a2ba3267
...
...
@@ -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
)
...
...
test/test-sanddance-facet.html
View file @
a2ba3267
...
...
@@ -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
({},
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment