Comments (10)
@geoffdavis92 : Thank you very much for your contribution! π
We updated the first entry in this issue to include the list of tools that exist and would ideally be extracted into their own files.
Also, it sounds great to aim at migrating these global functions towards Webpack. Once the tools are extracted, that should be easier and could be our aim? :) I agree with @xgui3783 !!! π
from microdraw.
i am separating the bezierToPolygon function!
from microdraw.
in pull request #76 you can see how to encapsulate tools like draw
and draw
polygon that require a mouseDown
and a mouseUp
handler. This should help encapsulating some other tools. It doesn't work for tools that require the mouseDrag
handler, such as rotate
.
The encapsulation is not complete, and there are still references to the "draw" and "drawPolygon" tool in microdraw.js
. These should be completely removed when the encapsulation will be finished.
from microdraw.
for all tools that simply require a click, this is the way to go:
-
find the function you would like to separate inside public/js/microdraw.js
-
extract the function's code from microdraw.js and add your separated tool to the /public/js/tools/yourTool.js
-
add your tool to the Microdraw object's extension (search inside public/js/microdraw.js for
// extend Microdraw with tools
and add the two according lines there
- and change it in the switch case for your tool by finding your tool inside public/js/microdraw.js
switch(me.selectedTool) {
and you are done π
\ΓΆ/ thank youuuu
from microdraw.
@katjaq are there any more tools that need extraction? I can't readily identify any remaining tools.
Also, is there any desire to migrate to using ES Modules and Webpack? It seems like this issue and #59 would greatly benefit from having explicitly-listed module imports/exports in each file, and would likely make debugging/adding features easier. (Take with a grain of salt, I'm just looking through the codebase, so there's likely nuances I'm missing)
from microdraw.
ES module would be a godsent.
Was going to make a snarky remark about the complexity of webpack, but after some mental gymnastics, I came to the conclusion that it definitely could work.
If there are enough interest we could implement.
from microdraw.
@xgui3783 cool. I'm not sure what the unique challenges are since I haven't looked at this codebase very in-depth, but wanted to offer this as an option, since that's essentially what this is asking for.
I'd be willing to help migrate these global functions towards Webpack and setup the config; I'm in no way a master but have been using it frequently on a number of side projects.
from microdraw.
from microdraw.
i'll work on splitRegion
! done :D
from microdraw.
cool! :)
I'll work on select
! done :D
from microdraw.
Related Issues (20)
- Server constantly checking for access token HOT 2
- Ability to programmatically upload contours HOT 8
- update readme
- tests for /upload endpoint, allow for memory storage over fs by configuration HOT 3
- Differentiate Replace or Merge existing contours with imported ones
- Validate the json files before accepting a programmatic upload
- Inconsistency saving after 'AddRegion' and 'SubstractRegion' HOT 3
- Add test to compound path
- Using Rollup for bundling? HOT 2
- Should we avoid using `reject` when no data is found? HOT 3
- Running the mocha tests erases the complete MongoDB HOT 2
- flip region not working HOT 1
- changes requested
- Use random region UIDs HOT 1
- splitRegion desynchronises data and display region structures
- Panel slider button in "project" mode does not work in iOs
- Amplify size of movement needed to displace a region HOT 1
- Regarding microw embed into application HOT 1
- Microdraw tool as a library HOT 3
- adding additional slices to json config file
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 microdraw.