Comments (11)
from dropchop.
from dropchop.
Confirming that the second "miles", "km", "meters", etc. are working properly:
from dropchop.
This is looking great!
from dropchop.
whoohooo!
from dropchop.
Thanks!
It's all a bit hacky right now, and I'd like some feedback on the Forms.js
as well as my (horrific) attempt to pass events back to the controller and interact with them via subscriptions. I think this event handler is pretty wacky, since I'm looping through the operations to find the Class
since all I seem to be able to retrieve is an object copy of the class, that no longer contains the operation.execute()
function. Any ideas?
from dropchop.
Here's a template for adding a new operation to AppController.js
.addChild(new L.DNC.TurfOperation('buffer', {
maxFeatures: 1,
additionalArgs: 0.1,
description: 'DESCRIPTION.',
parameters: [
// PARAMETER 1 OBJECT
{
name: 'PARAMETER 1',
description: 'PARAMETER 1 DESCRIPTION',
type: 'number',
default: 10
},
// PARAMETER 2 OBJECT
{
name: 'PARAMETER 2',
type: 'select',
description: 'PARAMETER 2 DESCRIPTION',
options: ['OPTION 1', 'OPTION 2', 'OPTION 3', 'OPTION 4'],
default: 'OPTION 3'
}
]
}))
from dropchop.
The template looks good. I'm starting to worry that putting all this implementation within these lines is making the app difficult to test. I've been looking through some integration test tools lately hoping that one of those could solve this problem.
I think this event handler is pretty wacky, since I'm looping through the operations to find the
Class
since all I seem to be able to retrieve is an object copy of the class, that no longer contains theoperation.execute()
function. Any ideas?
Yeah, there seems like there should be an easier way to do that part. The objects should have execute()
available, will try to figure out why they don't. Will also look through forms.js
when I get a chance.
from dropchop.
I wonder if the .addChild()
portions are complicating the workflow in AppController.js
. Would it be okay to break them apart in to their own pieces for simpler access in the controller? Something like
// create geoprocessing menu with whatever turf operations we want
this.menu.geoprocessing = new L.DNC.MenuBar( /* options */ );
// create new way to access turf operations, which can be run after
// the event fires with a string like 'buffer'
this.operations.turf = new L.DNC.Operation( /* options, which could be specified in unique files i.e. buffer.js */ );
// now we can execute these operations when an item is clicked
this.menu.geoprocessing.on('clicked', this.operations.turf( /* operation id */ );
from dropchop.
Yeah, I think you're spot on about the problem relating to addChild()
. I don't think I quite understand your example. Does this.menu.geoprocessing
define the operation? Or is that within this.operations.turf? And then the actual handling of the operation doesn't occur until
this.menu.geoprocessing.on`? Is don't quite understand that.
With that said, I think you're right with the idea of breaking out operations into their own files. I wanted to avoid that initially but now I'm thinking that it could improve testability.
When I originally commented, I thought this was a PR. Is this all related to #63?
from dropchop.
When I originally commented, I thought this was a PR. Is this all related to #63?
Mostly! This conversation is a result of #63, but maybe not directly related since it involves some refactoring. I'm going to turn that PR into a larger refactor, though. Is that okay with you?
I don't quite understand that.
I'm kinda confusing myself as well. 😜 When you say "breaking out operations into their own files" is what I was imagining when putting that together. They are going to rely on each other, that's for sure, but I think they can all be their own individual Classes without getting spaghetti'd together.
I'm going to play around with some hypothetical ways to break apart the different operations into their own classes and see what happens. I'll share some results later this evening! Going to continue working on #63 and turn it into a larger refactor since I want to keep the Form.js
pieces running.
from dropchop.
Related Issues (20)
- Need documentation for "Uploading Files" HOT 4
- Need documentation on adding data via URL. HOT 1
- Need documentation for adding data via OSM HOT 2
- Need documentation for adding data via Gist HOT 1
- Need documentation for adding data via Feature Service HOT 3
- Need documentation for adding User Location as a layer HOT 2
- Need documentation on exporting data as GeoJSON
- Need documentation on exporting data via TopoJSON HOT 3
- Need documentation on exporting data via Shapefile HOT 1
- Travis CI builds failing HOT 2
- Support 'ctrl' key for multiple layer select in Ubuntu HOT 14
- Points buffer omits some points HOT 9
- State of the Chop HOT 6
- Update to turf 3.0 HOT 4
- what is ./src/lib/shp-2-geojson.js HOT 1
- Modularize turf dependencies HOT 3
- Simplify browserify bundles with `require` module HOT 7
- Add turf.sample HOT 1
- Dropchop w/ React.js + Redux HOT 2
- Fix tests/phantomJS HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dropchop.