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
ecd5728a
You need to sign in or sign up before continuing.
Commit
ecd5728a
authored
Mar 16, 2015
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid setting c3 class to body - #1014
parent
97998e29
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
18 deletions
+14
-18
c3.js
c3.js
+7
-9
c3.min.js
c3.min.js
+0
-0
axis.js
src/axis.js
+4
-5
text.js
src/text.js
+3
-4
No files found.
c3.js
View file @
ecd5728a
...
...
@@ -3302,8 +3302,8 @@
];
};
c3_chart_internal_fn
.
getTextRect
=
function
(
text
,
cls
)
{
var
body
=
this
.
d3
.
select
(
'body
'
).
classed
(
'c3'
,
true
),
svg
=
bod
y
.
append
(
"svg"
).
style
(
'visibility'
,
'hidden'
).
style
(
'position'
,
'fixed'
).
style
(
'top'
,
0
).
style
(
'left'
,
0
),
var
dummy
=
this
.
d3
.
select
(
'body'
).
append
(
'div
'
).
classed
(
'c3'
,
true
),
svg
=
dumm
y
.
append
(
"svg"
).
style
(
'visibility'
,
'hidden'
).
style
(
'position'
,
'fixed'
).
style
(
'top'
,
0
).
style
(
'left'
,
0
),
rect
;
svg
.
selectAll
(
'.dummy'
)
.
data
([
text
])
...
...
@@ -3311,8 +3311,7 @@
.
classed
(
cls
?
cls
:
""
,
true
)
.
text
(
text
)
.
each
(
function
()
{
rect
=
this
.
getBoundingClientRect
();
});
svg
.
remove
();
body
.
classed
(
'c3'
,
false
);
dummy
.
remove
();
return
rect
;
};
c3_chart_internal_fn
.
generateXYForText
=
function
(
areaIndices
,
barIndices
,
lineIndices
,
forX
)
{
...
...
@@ -4401,7 +4400,7 @@
};
Axis
.
prototype
.
getMaxTickWidth
=
function
getMaxTickWidth
(
id
,
withoutRecompute
)
{
var
$$
=
this
.
owner
,
config
=
$$
.
config
,
maxWidth
=
0
,
targetsToShow
,
scale
,
axis
,
bod
y
,
svg
;
maxWidth
=
0
,
targetsToShow
,
scale
,
axis
,
dumm
y
,
svg
;
if
(
withoutRecompute
&&
$$
.
currentMaxTickWidths
[
id
])
{
return
$$
.
currentMaxTickWidths
[
id
];
}
...
...
@@ -4418,16 +4417,15 @@
axis
=
this
.
getXAxis
(
scale
,
$$
.
xOrient
,
$$
.
xAxisTickFormat
,
$$
.
xAxisTickValues
,
false
,
true
,
true
);
this
.
updateXAxisTickValues
(
targetsToShow
,
axis
);
}
body
=
$$
.
d3
.
select
(
'body
'
).
classed
(
'c3'
,
true
);
svg
=
bod
y
.
append
(
"svg"
).
style
(
'visibility'
,
'hidden'
).
style
(
'position'
,
'fixed'
).
style
(
'top'
,
0
).
style
(
'left'
,
0
),
dummy
=
$$
.
d3
.
select
(
'body'
).
append
(
'div
'
).
classed
(
'c3'
,
true
);
svg
=
dumm
y
.
append
(
"svg"
).
style
(
'visibility'
,
'hidden'
).
style
(
'position'
,
'fixed'
).
style
(
'top'
,
0
).
style
(
'left'
,
0
),
svg
.
append
(
'g'
).
call
(
axis
).
each
(
function
()
{
$$
.
d3
.
select
(
this
).
selectAll
(
'text'
).
each
(
function
()
{
var
box
=
this
.
getBoundingClientRect
();
if
(
maxWidth
<
box
.
width
)
{
maxWidth
=
box
.
width
;
}
});
svg
.
remove
();
dummy
.
remove
();
});
body
.
classed
(
'c3'
,
false
);
}
$$
.
currentMaxTickWidths
[
id
]
=
maxWidth
<=
0
?
$$
.
currentMaxTickWidths
[
id
]
:
maxWidth
;
return
$$
.
currentMaxTickWidths
[
id
];
...
...
c3.min.js
View file @
ecd5728a
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/axis.js
View file @
ecd5728a
...
...
@@ -265,7 +265,7 @@ Axis.prototype.textAnchorForY2AxisLabel = function textAnchorForY2AxisLabel() {
};
Axis
.
prototype
.
getMaxTickWidth
=
function
getMaxTickWidth
(
id
,
withoutRecompute
)
{
var
$$
=
this
.
owner
,
config
=
$$
.
config
,
maxWidth
=
0
,
targetsToShow
,
scale
,
axis
,
bod
y
,
svg
;
maxWidth
=
0
,
targetsToShow
,
scale
,
axis
,
dumm
y
,
svg
;
if
(
withoutRecompute
&&
$$
.
currentMaxTickWidths
[
id
])
{
return
$$
.
currentMaxTickWidths
[
id
];
}
...
...
@@ -282,16 +282,15 @@ Axis.prototype.getMaxTickWidth = function getMaxTickWidth(id, withoutRecompute)
axis
=
this
.
getXAxis
(
scale
,
$$
.
xOrient
,
$$
.
xAxisTickFormat
,
$$
.
xAxisTickValues
,
false
,
true
,
true
);
this
.
updateXAxisTickValues
(
targetsToShow
,
axis
);
}
body
=
$$
.
d3
.
select
(
'body
'
).
classed
(
'c3'
,
true
);
svg
=
bod
y
.
append
(
"svg"
).
style
(
'visibility'
,
'hidden'
).
style
(
'position'
,
'fixed'
).
style
(
'top'
,
0
).
style
(
'left'
,
0
),
dummy
=
$$
.
d3
.
select
(
'body'
).
append
(
'div
'
).
classed
(
'c3'
,
true
);
svg
=
dumm
y
.
append
(
"svg"
).
style
(
'visibility'
,
'hidden'
).
style
(
'position'
,
'fixed'
).
style
(
'top'
,
0
).
style
(
'left'
,
0
),
svg
.
append
(
'g'
).
call
(
axis
).
each
(
function
()
{
$$
.
d3
.
select
(
this
).
selectAll
(
'text'
).
each
(
function
()
{
var
box
=
this
.
getBoundingClientRect
();
if
(
maxWidth
<
box
.
width
)
{
maxWidth
=
box
.
width
;
}
});
svg
.
remove
();
dummy
.
remove
();
});
body
.
classed
(
'c3'
,
false
);
}
$$
.
currentMaxTickWidths
[
id
]
=
maxWidth
<=
0
?
$$
.
currentMaxTickWidths
[
id
]
:
maxWidth
;
return
$$
.
currentMaxTickWidths
[
id
];
...
...
src/text.js
View file @
ecd5728a
...
...
@@ -48,8 +48,8 @@ c3_chart_internal_fn.redrawText = function (xForText, yForText, forFlow, withTra
];
};
c3_chart_internal_fn
.
getTextRect
=
function
(
text
,
cls
)
{
var
body
=
this
.
d3
.
select
(
'body
'
).
classed
(
'c3'
,
true
),
svg
=
bod
y
.
append
(
"svg"
).
style
(
'visibility'
,
'hidden'
).
style
(
'position'
,
'fixed'
).
style
(
'top'
,
0
).
style
(
'left'
,
0
),
var
dummy
=
this
.
d3
.
select
(
'body'
).
append
(
'div
'
).
classed
(
'c3'
,
true
),
svg
=
dumm
y
.
append
(
"svg"
).
style
(
'visibility'
,
'hidden'
).
style
(
'position'
,
'fixed'
).
style
(
'top'
,
0
).
style
(
'left'
,
0
),
rect
;
svg
.
selectAll
(
'.dummy'
)
.
data
([
text
])
...
...
@@ -57,8 +57,7 @@ c3_chart_internal_fn.getTextRect = function (text, cls) {
.
classed
(
cls
?
cls
:
""
,
true
)
.
text
(
text
)
.
each
(
function
()
{
rect
=
this
.
getBoundingClientRect
();
});
svg
.
remove
();
body
.
classed
(
'c3'
,
false
);
dummy
.
remove
();
return
rect
;
};
c3_chart_internal_fn
.
generateXYForText
=
function
(
areaIndices
,
barIndices
,
lineIndices
,
forX
)
{
...
...
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