feat: add sort function to vega-functions (and vega-interpreter)#3973
feat: add sort function to vega-functions (and vega-interpreter)#3973
vega-functions (and vega-interpreter)#3973Conversation
Deploying vega with
|
| Latest commit: |
5e6190d
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://8a4c23d3.vega-628.pages.dev |
| Branch Preview URL: | https://cameron-yick-sort-functions.vega-628.pages.dev |
3daa1d7 to
a105f40
Compare
test(vega-functions): unit test and export sort
a105f40 to
5e6190d
Compare
vega-functions (in addition to vega-interpreter)
vega-functions (in addition to vega-interpreter)vega-functions (in addition to vega-interpreter)
vega-functions (in addition to vega-interpreter)vega-functions (and vega-interpreter)
|
This is great, thank you @hydrosquall ! One thing that I noticed is that when there is a mix of numbers and strings, it seems like this function sorts them as subarrays: first it sorts all the string until the first number, then all the numbers, then all the string after the last number: I would expect the output to be |
|
Thanks for having a close look @joelostblom , it's cool to see how those subarrays are handled in Javascript sorting! I'm not sure what to expect if we mix datatypes beyond the known sentinel values like |
|
Thank you both! |
changes since v5.30.0 **vega-utils** * use `Object.hasOwn` instead of `Object.prototype.hasOwnProperty` (via #3951). (Thanks @domoritz!) **vega-parser** * Add discrete legend type (via #3957). (Thanks @hydrosquall!) **vega-functions** * Add sort function to vega-functions (and vega-interpreter) (via #3973). (Thanks @hydrosquall!) **vega-selections** * Add field predicate types to selectionTest (via #3675). (Thanks @jonathanzong!) **monorepo** * Replace flights-5k.json external reference (via #3999). (Thanks @dwootton!) **docs** * Update packed bubble example (via #3955). (Thanks @PBI-David!) * Correct typo in production rules documentation (via #3958). (Thanks @shanebruggeman!) * Update README.md to fix broken link to current roadmap (via #3979). (Thanks @cahogan & @joelostblom!) --------- Signed-off-by: Lukas Hermann <1734032+lsh@users.noreply.github.com>
…a-interpreter` (#4009) ## Motivation - Allow users to modify SVG images that were Base64 encoded. This is useful in Vega-Lite environments where remote access to images was disabled, such as Deneb (PowerBI), so users are especially dependent on inline data definitions. - See #3875 ## Testing - Try test URL sandbox showing that images can be encoded/decoded [link](https://cameron-yick-feature-add-bas.vega-628.pages.dev/#/url/vega-lite/N4IgJAzgxgFgpgWwIYgFwhgF0wBwqgegIDc4BzJAOjIEtMYBXAI0poHsDp5kTykBaADZ04JAKyUAVhDYA7EABoQAEySYUqUMSSCGcCGgDaoDSACCikEzQAmABwBfBSbQgAQpeuoxYpy-QAwp5oACwAzA4Auk4gyABOANauTEhxlnCyUGzKNLJkaKAAngUgAGY0cILKrhlZynDVSpiFOHCusmwIuTogMQAeJeWV1eg09bKYdMVNLW3oHV2yPTFZgmxpmmUVVa4oM63tnd2CloLkGSOyDIKCDjGYcUiyEKXrCEagUDpQ12pzIGo2EwABRMTBsJDA1SYBgIShIACUCMsSAMo3Gk2avWcIC+gh+gj+yXBkOhsPhyKUqJqmWyDV60SAA) - Make sure it works with AND without vega-interpreter mode: vega/editor#1460 - I did not unit test this change yet as the function is a core web API. However, if it would be useful to have at least 1 spec that uses both atob and btoa, I can add one. ## Notes - btoa / atob: check the status for node.js usage ( DefinitelyTyped/DefinitelyTyped#65494 ) since the Node.js world prefers using `Buffer.from(` instead. - Check why/if this is different from what we did for vega-functions in #3973 - To get the scenegraph for my test, I visited https://cameron-yick-feature-add-bas.vega-628.pages.dev/#/edited, used and used `VEGA_DEBUG.view` to get a sample scenegraph.

Motivation
This PR tests a fix for #3962 , with the goal of adding a
sortfunction to the default set of Vega functions in the expression language.Changes
vega-interpretercommits from feat: add sort expressions #3962, rebased against latestmainvega-functions: 5e6190d#diff-328f6311e6ab7be84b1167d9ca245bea77f0ae6e078ffcd4b71bb7b2340e810bTesting
yarn link vegaUses test spec JSON: