whosonfirst / whosonfirst-www-spelunker

A simple Flask-based spelunker for poking around Who's On First data
BSD 3-Clause "New" or "Revised" License
7 stars 9 forks source link

Investigate use of something CSS-like for features... #115

Open thisisaaronland opened 7 years ago

thisisaaronland commented 7 years ago

tl;dr - Please don't make me write a CSS parser...

Meanwhile, things to consider/cherry-pick:

One thing I am not keen on with any of the things listed above is the absence of support for a remote stylesheet. It seems like it would be trivial to patch leaflet.geojsoncss.js to fetch a style declaration over the wire and invoke the various leaflet methods accordingly.

Maybe that is the simplest-dumbest thing with a stylesheet per placetype or geometry type but it would be nice to have custom styling based on properties... but then we're writing a CSS parser which is not good...

Dunno.

cc @stepps00 because he was asking for magic diff-styling (in GitHub) and pointed me to the Mapbox thing; unsure how many of these various specs are supported in the GitHubs?

cc @dphiffer and @sdombkow because they are set to think about properties and centroids, soon.

cc @bcamper and @louh because something something something Tangram something something something maps something something something style definitions... something something something?

nvkelso commented 7 years ago

Also an option: piping the result set to Tangram as a GeoJSON source and letting data-driven styling in Tangram work it's magic.

thisisaaronland commented 7 years ago

Now you have sin(x, y, z) problems.

louh commented 7 years ago

I lack 100% of the context of this discussion, but my thoughts are:

  1. why not CartoCSS?
  2. if you need to parse CSS at all, PostCSS is the thing everyone is using in front-end land.
  3. If you want to use a CSS syntax that entirely mimics actual supported CSS rules, load a normal CSS file and then look it up with document.styleSheets. It gets parsed for you.
thisisaaronland commented 7 years ago

@louh CartoCSS would be fine with me assuming it has:

What I am unclear on is whether any of this is possible with the crop of tooling.

stepps00 commented 7 years ago

I contacted GitHub support about the geometry diff rendering tool; they still support v1.1.0 of the simplestyle-spec. They also linked back to their blog post about the diff rendering:

https://github.com/blog/1772-diffable-more-customizable-maps

I replied to ask if there are ways to invoke this tool in a way that does not involve adding properties to every record...

stepps00 commented 7 years ago

Per GitHub support:

The only way to view a diff on GitHub is to view a change in a file. You could view 
the diff for the change of the file being created, but I don't believe this will 
give you the red/green highlight you want. The whole map will be new and all 
green.

I don't think it's possible to view the diff in the way you want without applying a 
change to each file.
nvkelso commented 7 years ago

There should be some .git setting for default GeoJSON simplestyle settings (rather than mod'ing all files :\

stepps00 commented 7 years ago

The command to view records in a different Git branch is:

git show branch:file

If I was working in a branch called stepps00-issue877 and wanted to view the version of 1108784755.geojson in master, I would use:

git show master:data/110/878/475/5/1108784755.geojson

@thisisaaronland