Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master ticket tracking expression API completeness #6484

Open
6 of 16 tasks
anandthakker opened this issue Apr 9, 2018 · 5 comments
Open
6 of 16 tasks

Master ticket tracking expression API completeness #6484

anandthakker opened this issue Apr 9, 2018 · 5 comments
Labels
api 📝 cross-platform 📺 Requires coordination with Mapbox GL Native (style specification, rendering tests, etc.)

Comments

@anandthakker
Copy link
Contributor

anandthakker commented Apr 9, 2018

This ticket is intended to define what set of operators would constitute a "complete" expression API and track its implementation.

@anandthakker anandthakker added cross-platform 📺 Requires coordination with Mapbox GL Native (style specification, rendering tests, etc.) api 📝 labels Apr 9, 2018
@1ec5
Copy link
Contributor

1ec5 commented Apr 26, 2018

All the relevant functions from NSExpression

Inspired by this issue, I attempted to compile a similar issue to track feature parity with NSPredicate and NSExpression: mapbox/mapbox-gl-native#11786.

@gorshkov-leonid
Copy link
Contributor

gorshkov-leonid commented Aug 16, 2018

Hi, I have not found

  1. toHex(or toString(16))
  2. substrig to save to variable
  3. modification operation: variable(set) / object(set) / array(splice)
  4. how about supporting #FFFFFFFF(8 bytes) from css4 - number->to-color?
    So. all ideas from https://gist.github.com/gorshkov-leonid/bd4d603fd049f4419983cfb80e221688, I think it is verry complicated solution and new features can make it better

@stevage
Copy link
Contributor

stevage commented Apr 7, 2020

Oh, I didn't know about this ticket!

Me, I would love more string-handling functions:

  • left
  • right
  • split
  • titlecase (yes I know it's difficult to do in a locale-independent way)

@lbutler
Copy link
Contributor

lbutler commented Apr 16, 2020

Oh, I didn't know about this ticket!

Me, I would love more string-handling functions:

  • left
  • right
  • split
  • titlecase (yes I know it's difficult to do in a locale-independent way)

@stevage, just letting you know that my PR #9450 was merged in and soon you will have slice which you can use on strings to do left/right/mid. Check out #9443 to see some examples.

It's not perfect but if you had just a single word you could always slice the first letter and uppercase it and concat with the remainder of the string, something like the below (untested!)

['concat', ['upcase', ['slice', ['get','attributeToTitleCase'], 0 ,1]], ['downcase', ['slice', ['get','attributeToTitleCase'], 1]]]

@FinnRG
Copy link

FinnRG commented Aug 7, 2024

@mourner We extended mapbox-gl with a few basic date functions (new datetype, epoch: int -> date, hour and minute to get those values from a date value). Those are obviously pretty specific for our use case, but I could dedicate time to implement a more general date API.

My questions would be:

  • Is such an extension desired by the mapbox team?
  • What should the API surface look like? (Timezone handling, date formats, etc.)
  • Is a port of these APIs to the react native SDK a minimum requirement?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api 📝 cross-platform 📺 Requires coordination with Mapbox GL Native (style specification, rendering tests, etc.)
Projects
None yet
Development

No branches or pull requests

6 participants