You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2019/12/19 11:15:07 UTC
[GitHub] [incubator-echarts] Ovilia opened a new issue #11878: More powerful
formatters: pipes
Ovilia opened a new issue #11878: More powerful formatters: pipes
URL: https://github.com/apache/incubator-echarts/issues/11878
### What problem does this feature solve?
ECharts has many `formatter` options, which provides a flexible display method in both forms of string and function.
In some cases, function is not applicative, like formatters in theme or in Baidu Smart App.
So, I'd suggest we provide some frequently used pipes so that users can use it in string format.
### What does the proposed API look like?
- `{a | thousandSeparator} kg`: if `{a}` is 1234567, the output is `1,234,567 kg`.
- `{b | decimalPlaces: 2}cm`: if `{b}` is 12.3456, the output is `12.34cm`.
- ...
<!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
<!-- This issue is in English. DO NOT REMOVE -->
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [incubator-echarts] 100pah edited a comment on issue #11878:
[PROPOSAL] More powerful formatters: pipes
Posted by GitBox <gi...@apache.org>.
100pah edited a comment on issue #11878: [PROPOSAL] More powerful formatters: pipes
URL: https://github.com/apache/incubator-echarts/issues/11878#issuecomment-568914900
> We can check if it's a pipe name. If not, it's rich.
I am still worried that it brings bad readability. And if we might pre-compile the pattern to optimize the performance one day, it might brings trouble to the compilation.
If we do not name it as "pipe", but name it as "filter", is it might not necessarily use the "pipe symbol"?
Could it use `{a :| someFilter1 :| someFile2}` ?
BTW, write something related in #11906
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [echarts] github-actions[bot] commented on issue #11878: [PROPOSAL] More powerful formatters: pipes
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #11878:
URL: https://github.com/apache/echarts/issues/11878#issuecomment-1003618828
This issue has been automatically closed because it did not have recent activity. If this remains to be a problem with the latest version of Apache ECharts, please open a new issue and link this to it. Thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [incubator-echarts] 100pah commented on issue #11878: [PROPOSAL]
More powerful formatters: pipes
Posted by GitBox <gi...@apache.org>.
100pah commented on issue #11878: [PROPOSAL] More powerful formatters: pipes
URL: https://github.com/apache/incubator-echarts/issues/11878#issuecomment-568914900
> We can check if it's a pipe name. If not, it's rich.
I am still worried that it brings bad readability. If we do not name it 'pipe', but name it 'filter', is it might not necessarily use the "pipe symbol"?
BTW, write something related in #11906
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [incubator-echarts] 100pah edited a comment on issue #11878:
[PROPOSAL] More powerful formatters: pipes
Posted by GitBox <gi...@apache.org>.
100pah edited a comment on issue #11878: [PROPOSAL] More powerful formatters: pipes
URL: https://github.com/apache/incubator-echarts/issues/11878#issuecomment-568914900
> We can check if it's a pipe name. If not, it's rich.
I am still worried that it brings bad readability. If we do not name it as "pipe", but name it as "filter", is it might not necessarily use the "pipe symbol"?
BTW, write something related in #11906
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [incubator-echarts] 100pah commented on issue #11878: More powerful
formatters: pipes
Posted by GitBox <gi...@apache.org>.
100pah commented on issue #11878: More powerful formatters: pipes
URL: https://github.com/apache/incubator-echarts/issues/11878#issuecomment-568864320
But we can not tell which is rich text and and which is pipe.
```js
formatter: 'xxxx {style1 | $money} {a | $thousandSeparator}}'
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [incubator-echarts] kristalhu commented on issue #11878: [PROPOSAL]
More powerful formatters: pipes
Posted by GitBox <gi...@apache.org>.
kristalhu commented on issue #11878: [PROPOSAL] More powerful formatters: pipes
URL: https://github.com/apache/incubator-echarts/issues/11878#issuecomment-568915462
How can we check
Sent from Yahoo Mail for iPhone
On streda, decembra 25, 2019, 5:43 PM, sushuang <no...@github.com> wrote:
We can check if it's a pipe name. If not, it's rich.
I am still worried that it brings bad readability. If we do not name it 'pipe', but name it 'filter', is it might not necessarily use the "pipe symbol"?
BTW, write something related in #11906
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [echarts] github-actions[bot] closed issue #11878: [PROPOSAL] More powerful formatters: pipes
Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed issue #11878:
URL: https://github.com/apache/echarts/issues/11878
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [incubator-echarts] Ovilia edited a comment on issue #11878: More
powerful formatters: pipes
Posted by GitBox <gi...@apache.org>.
Ovilia edited a comment on issue #11878: More powerful formatters: pipes
URL: https://github.com/apache/incubator-echarts/issues/11878#issuecomment-568863187
I don't think it's a good idea to use other separators rather than `|` because `|` is more commonly used and thus makes users understand it better.
As for the rich text conflict, I think maybe we can use special formatter name for built-in pipes like `{a | $thousandSeparator} kg` or `{a | #thousandSeparator} kg`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [echarts] github-actions[bot] commented on issue #11878: [PROPOSAL] More powerful formatters: pipes
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #11878:
URL: https://github.com/apache/echarts/issues/11878#issuecomment-1000931394
This issue has been automatically marked as stale because it did not have recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this issue.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [incubator-echarts] 100pah commented on issue #11878: More powerful
formatters: pipes
Posted by GitBox <gi...@apache.org>.
100pah commented on issue #11878: More powerful formatters: pipes
URL: https://github.com/apache/incubator-echarts/issues/11878#issuecomment-568799711
The grammar `{a | method} ` conflicts with rich text (`{styleName|real text}`).
Probably it needs to consider another grammar.
```js
// (A) ?
formatter: '{a : method1 : method2(123)}'
formatter: 'xxxx {style1|{a : method1 : method2(123)}}' // in rich text
formatter: 'xxxx {style1|yyyy} {a : method1 : method2(123)}' // in rich text
// (B) ?
formatter: '{a => method1 => method2(123)}'
formatter: 'xxxx {style1|{a => method1 => method2(123)}}' // in rich text
formatter: 'xxxx {style1|yyyy} {a => method1 => method2(123)}' // in rich text
// (C) ?
formatter: '{a # method1 # method2(123)}'
formatter: 'xxxx {style1|{a # method1 # method2(123)}}' // in rich text
formatter: 'xxxx {style1|yyyy} {a # method1 # method2(123)}' // in rich text
// (D) ?
formatter: '{a $ method1 $ method2(123)}'
formatter: 'xxxx {style1|{a $ method1 $ method2(123)}}' // in rich text
formatter: 'xxxx {style1|yyyy} {a $ method1 $ method2(123)}' // in rich text
```
We'd better avoid common calculation characters are used as delimiter.
And we may also need to consider some how it makes break change and how to escape functional characters like
`{` `}` `|`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [incubator-echarts] 100pah edited a comment on issue #11878: More
powerful formatters: pipes
Posted by GitBox <gi...@apache.org>.
100pah edited a comment on issue #11878: More powerful formatters: pipes
URL: https://github.com/apache/incubator-echarts/issues/11878#issuecomment-568864320
But we can not tell which is rich text and and which is pipe.
```js
formatter: 'xxxx {style1 | $money} {a | $thousandSeparator}'
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [incubator-echarts] Ovilia commented on issue #11878: More powerful
formatters: pipes
Posted by GitBox <gi...@apache.org>.
Ovilia commented on issue #11878: More powerful formatters: pipes
URL: https://github.com/apache/incubator-echarts/issues/11878#issuecomment-568863187
I don't think it's a good idea to use other separators rather than `|` because `|` is more common used and thus makes users understand it better.
As for the rich text conflict, I think maybe we can use special formatter name for built-in pipes like `{a | $thousandSeparator} kg` or `{a | #thousandSeparator} kg`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [incubator-echarts] Ovilia commented on issue #11878: [PROPOSAL]
More powerful formatters: pipes
Posted by GitBox <gi...@apache.org>.
Ovilia commented on issue #11878: [PROPOSAL] More powerful formatters: pipes
URL: https://github.com/apache/incubator-echarts/issues/11878#issuecomment-568872766
We can check if it's a pipe name. If not, it's rich.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org