hhzl / amber-graphical-libraries-demo Goto Github PK
View Code? Open in Web Editor NEWShows how to include paperjs in Amber Smalltalk.
License: MIT License
Shows how to include paperjs in Amber Smalltalk.
License: MIT License
Class Paper2
has a newPath
method which gives back an instance of a JSProxyObject
. However when I send a message to that object I get an error *too much recursion.
!Paper2 class methodsFor: 'not yet classified'!
newPath
<return (new paper.Path());>
!
main
| canvas aPath |
canvas := document getElementById: 'myCanvas'.
"Create an empty project and a view for the canvas:"
paper setup: canvas.
aPath := self newPath.
"Give the stroke a color"
aPath inspect.
aPath strokeColor: 'red'.
!
Note Class Paper1
is a JavaScript only solution which works. The aim of class Paper2
is to have it translated into Smalltalk.
In #2 the installation instructions were updated. Now bower.json has to reflect this.
Is the way used to include the in index.html
correct?
<script type='text/javascript'>
require.config({ paths: {
'paper': 'bower_components/paper/dist'
}});
require([
'bower_components/paper/dist/paper-full.js'
], function( Paper ){
window.Paper=Paper;
}
);
</script>
In addition I wonder why the Paper
variable starts with uppercase whereas in the code Paper1>>main
it is referenced with lowercase paper
Herby writes to the ML
No manual editing of bower.json
You can do it without manually editing bower.json. Just run
bower install paper --save
You should go the standard way.
Standard way is to install by bower with --save, not editing bower.json by hand. It then should produce good pattern.
The usual pattern is something like "~0.5.3-alpha" which says "any from the same family as 0.5.3-alpha is", that is, 0.5.whatever.
The comma after "physicsjs": "~0.6.0" needs to be removed. bower install currently fails due to that typo
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.