Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
c3-closed
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Evgeny
c3-closed
Commits
fd5fbeab
Commit
fd5fbeab
authored
Aug 11, 2015
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update bubble r
parent
920d378d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
6 deletions
+15
-6
bubble.js
extensions/chart-bubble/bubble.js
+15
-6
No files found.
extensions/chart-bubble/bubble.js
View file @
fd5fbeab
...
...
@@ -39,7 +39,10 @@
this
.
config
.
point_r
=
function
(
d
)
{
var
names
=
extra
.
names
,
values
=
extra
.
values
,
base_length
=
extra
.
base_length
,
x
=
names
[
d
.
x
],
y
=
d
.
id
,
key
=
extra
.
getKey
(
x
,
y
),
max
,
min
,
a
,
value
,
r
;
x
=
names
[
d
.
x
],
y
=
d
.
id
,
key
=
extra
.
getKey
(
x
,
y
),
value
=
!
values
[
key
]
?
0
:
values
[
key
],
max
,
max_r
,
max_area
,
min
,
min_r
,
min_area
,
a
,
area
,
r
;
if
(
!
base_length
)
{
base_length
=
extra
.
base_length
=
d3
.
min
([
...
...
@@ -49,13 +52,19 @@
}
max
=
d3
.
max
(
Object
.
keys
(
values
).
map
(
function
(
key
)
{
return
values
[
key
];
}));
min
=
d3
.
min
(
Object
.
keys
(
values
).
map
(
function
(
key
)
{
return
values
[
key
];
}))
*
0.8
,
a
=
((
base_length
/
(
names
.
length
*
2
))
-
1
)
/
(
Math
.
log
(
max
+
1
)
-
Math
.
log
(
min
+
1
));
min
=
d3
.
min
(
Object
.
keys
(
values
).
map
(
function
(
key
)
{
return
values
[
key
];
}));
value
=
!
values
[
key
]
?
0
:
values
[
key
];
r
=
(
Math
.
log
(
value
+
1
)
-
Math
.
log
(
min
+
1
))
*
a
;
max_r
=
(
base_length
/
(
names
.
length
*
2
));
max_area
=
max_r
*
max_r
*
Math
.
PI
;
min_r
=
Math
.
sqrt
(
min
*
max_r
*
max_r
/
max
);
min_area
=
min_r
*
min_r
*
Math
.
PI
;
return
r
>
0
?
r
:
0
;
a
=
(
max_area
-
min_area
)
/
(
max
-
min
);
area
=
value
*
a
;
r
=
Math
.
sqrt
(
area
/
Math
.
PI
);
return
r
;
};
this
.
config
.
point_sensitivity
=
25
;
this
.
config
.
point_focus_expand_enabled
=
false
;
...
...
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