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

Classes + .d.ts #169

Closed
tmcw opened this issue Dec 23, 2014 · 15 comments
Closed

Classes + .d.ts #169

tmcw opened this issue Dec 23, 2014 · 15 comments

Comments

@tmcw
Copy link
Collaborator

tmcw commented Dec 23, 2014

What would it take to

  • Add types and classes to turf's hierarchy
  • document turf

Options

Quest

TypeScript has some warts:

Upstreams

name commonjs support documentation strings types typechecking bugs
tern yes, great yes yes no yes
jsdoc nope yes yes no ?
flow yes no yes yes yeahh
typescript nope yes yes yes yeahh
@tmcw
Copy link
Collaborator Author

tmcw commented Jan 7, 2015

Doc progress:

See doc docs for tips on how to contribute

  • isClockwise
  • isolines
  • isobands
  • merge
  • convex
  • within
  • concave
  • count
  • erase
  • variance
  • deviation
  • median
  • min
  • max
  • aggregate
  • flip
  • simplify
  • sum
  • average
  • bezier
  • tag
  • size
  • sample
  • jenks
  • quantile
  • envelope
  • square
  • midpoint
  • buffer
  • center
  • centroid
  • combine
  • distance
  • explode
  • extent
  • bboxPolygon
  • featurecollection
  • filter
  • grid
  • inside
  • intersect
  • linestring
  • nearest
  • planepoint
  • point
  • polygon
  • reclass
  • remove
  • tin
  • union
  • bearing
  • destination
  • hex
  • kinks
  • pointOnSurface
  • area

/cc @morganherlocker @lyzidiamond would love help on this when you get time, there are many modules to hit.

@mourner
Copy link
Contributor

mourner commented Jan 8, 2015

@tmcw btw, I'd love to see a hey post on your docs research and comparison of different approaches.

@tmcw
Copy link
Collaborator Author

tmcw commented Jan 8, 2015

Y, definitely worth a post, will pull it together in a bit.

@tmcw
Copy link
Collaborator Author

tmcw commented Jan 9, 2015

new thing: we have rpl-www installed for self-running and live-codable documentation. trick is to

  • don't use require() - this isn't node, so it won't be available
  • turf is available as a library by default
  • use //= comments to expose things

so for example:

var points = turf.featurecollection([
  turf.point(10.1953125, 43.75522505306928),
  turf.point(10.404052734375, 43.84245116699039),
  turf.point(10.579833984375, 43.6599240747891),
  turf.point(10.360107421875, 43.51668853502909),
  turf.point(10.140380859375, 43.58834891179792),
  turf.point(10.1953125, 43.75522505306928)]);

var result = turf.featurecollection(
  points.features.concat([turf.convex(points)]));
//=result

The line //=result is like saying 'make a map with what's in the variable result right now'.

  • I've been using turf.featurecollection a bunch to show before & after on the same map, but you can also do multiple maps by using //= comments twice or more
  • esprima seems to prefer semicolons. I'll look for the upstream cause but for now, non-asi style javascript is safest

@lyzidiamond
Copy link
Contributor

Let's knock this out! Goals of this walk-through:

  • Move examples away from Null Island
  • Fix any tests that have broken polygons
  • Conform styling (dashes, line-breaks)
  • For any modules that are confusing or have questions/issues on how to implement, comment here.
    • aggregate
    • average
    • bbox-polygon
    • bearing
    • bezier
    • buffer
    • center
      • Add styling to example to show difference between points
    • centroid
    • combine
    • concave
    • convex
    • count
    • destination
    • deviation
    • distance
    • envelope
    • erase
    • explode
    • extent
    • featurecollection
    • filter
    • flip
    • grid
    • hex
    • inside
    • intersect
    • isobands
    • isolines
    • jenks
    • kinks
    • linestring
    • max
    • median
    • merge
    • midpoint
    • min
    • nearest
    • planepoint
    • point
    • point-on-surface
    • polygon
    • quantile
    • reclass
    • remove
    • sample
    • simplify
    • size
    • square
    • sum
    • tag
    • tin
    • union
    • variance
    • within

cc @tmcw @morganherlocker

@morganherlocker
Copy link
Member

  • isolines is super difficult to use; I'll try to fix it up and document it better

@lyzidiamond
Copy link
Contributor

  • flip mutability issue (documented here and here) is preventing a working example

@tmcw
Copy link
Collaborator Author

tmcw commented Jan 14, 2015

Fixed flip mutability, we should start doing dev releases so we can rebuild the site's examples with pre-released bugfixes.

@tmcw
Copy link
Collaborator Author

tmcw commented Jan 15, 2015

Removed isClockwise from this list because it was removed from turf's public-facing api in #176

@tmcw
Copy link
Collaborator Author

tmcw commented Jan 15, 2015

Replaced all readFileSync()-using examples today and introduced turf.random to make more examples viable. Given the iffy status of the statsy modules (median min max variation average) and the tediousity & quantity of this work, I'm leaning towards hitting just a few more and jumping off this for anyone else to jump on and review.

@tmcw
Copy link
Collaborator Author

tmcw commented Jan 22, 2015

The deed is done (initially): just pushed all turfjs modules, syncing all versions and rewriting all readmes with doxme.

@lyzidiamond
Copy link
Contributor

Just completed a second run-through of the documentation. I feel comfortable saying we're good to go!

@tmcw
Copy link
Collaborator Author

tmcw commented Jan 30, 2015

👍 docs are launched and I think we can consider this stage complete ✋ all around!

@tmcw tmcw closed this as completed Jan 30, 2015
@morganherlocker
Copy link
Member

🎉 awesome work @lyzidiamond @tmcw! This is a huge step that took an enormous amount of effort.

@jseppi
Copy link
Member

jseppi commented Jan 30, 2015

Yeah, it's super great and provides a good model for other projects! 👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants