You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the best package to exploit Echarts. I really love it.
However, I've noticed an issue on e_mark_point() (also on e_mark_line() and e_mark_area()) that is the matching of the serie param uses .get_index(), which uses grep(), the regular expressions.
I don't understand the logic behind these three special functions. In my opinion, it's not consistent with other functions. More importantly, it makes the programming use of these functions difficult. Imagine if the series names contain character like () or the names like "abc" and "abcd".
library(echarts4r)
x<-data.frame(a=1:10, b=1:10, c=1:20)
e_chart(x, 'a') %>%
e_line('b', name='abcdefg', smooth=TRUE, symbol='none') %>%
e_line('c', name='abcd', smooth=TRUE, symbol='none') %>%
e_mark_point('abcd', data=list(xAxis=5, yAxis=5, value=5))
# the two series are both marked (click on the legend of abcd you will understand what I mean)# but we only want the second. Have to use `^abcd$`
My suggestion is completely get rid of grep(), making it exact match. Both regular expression way to match or partial match makes the function difficult to use programmingly.
Thanks!
The text was updated successfully, but these errors were encountered:
shrektan
added a commit
to shrektan/echarts4r
that referenced
this issue
Jun 7, 2019
Hi,
This is the best package to exploit Echarts. I really love it.
However, I've noticed an issue on
e_mark_point()
(also one_mark_line()
ande_mark_area()
) that is the matching of theserie
param uses.get_index()
, which usesgrep()
, the regular expressions.I don't understand the logic behind these three special functions. In my opinion, it's not consistent with other functions. More importantly, it makes the programming use of these functions difficult. Imagine if the series names contain character like
()
or the names like "abc" and "abcd".For example:
and
The related Code
echarts4r/R/mark.R
Line 51 in c2799f2
echarts4r/R/utils.R
Lines 550 to 555 in 5224fba
My suggestion
My suggestion is completely get rid of
grep()
, making itexact
match. Both regular expression way to match or partial match makes the function difficult to use programmingly.Thanks!
The text was updated successfully, but these errors were encountered: