Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
behaviors-ai-public
LaVizu
Commits
f176515c
Commit
f176515c
authored
Jun 03, 2019
by
Dorian Goepp
Browse files
Remove unnused method
parent
bd4cd38c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/LineChart/LineChart.js
View file @
f176515c
...
...
@@ -67,27 +67,6 @@ class LineChart extends Component {
}));
return
[
lower
,
upper
];
}
/**
* Add default values for the abscissa axis, if there is none
* @param {Object(Array(Object))} data the data to be plotted
*/
pre_process
(
data
)
{
let
new_data
=
{}
// Iterate over the plot names (keys in data)
Object
.
keys
(
data
).
forEach
((
name
)
=>
{
// Iterate over the data of the plot (entries in the Array)
new_data
[
name
]
=
data
[
name
].
map
((
entry
,
i
)
=>
{
// `entry` is an object supposed to have two keys: `x` and `y`. If the latter is missing, we add one based
// on the index of `entry` in the array.
if
(
!
(
'
x
'
in
entry
))
{
entry
.
x
=
i
;
}
return
entry
;
})
});
return
new_data
}
render
()
{
// Use the margin convention practice
...
...
@@ -98,7 +77,6 @@ class LineChart extends Component {
const
viewbox
=
"
0 0
"
+
(
width
+
margin
.
left
+
margin
.
right
)
+
"
"
+
(
height
+
margin
.
top
+
margin
.
bottom
);
const
data
=
this
.
props
.
data
;
// const data = this.pre_process(this.props.data);
// Allocate one colour per line to plot
const
lineNames
=
Object
.
keys
(
data
);
...
...
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