I wrote this app for a job application so it is really unpolished. It is a simple pictogram editor. I put it here to serve as a record of what I have done. If it is helpful to someone, I would be really happy.
The app is divided into 2 parts: the left is the editor area and the right is the canvas area.
There are 4 buttons in the editor area:
- Add Diagram - To add a pictogram with one item to the canvas. You can add as many as you like.
- Add Data - To add more data into the selected pictogram.
- Save as JSON - To save the working environment into a JSON file.
- Upload - To upload the previously saved pictogram.
You need to serve the page with a static page server. So if you are in *nix, the simplest way is to use:
python -m simpleHTTPServer
You can start to explore the app in 2 ways:
- Click the "Add Diagram" button and click on the new pictogram in the canvas area. The editor area will show all the options you can change to the pictogram. Click the "Add Data" button and observe there is a new item added to the picotgram. For each item, you can change its shape, color, value independently. Drag and move the pictogram to anywhere you like.
- Click the "Choose File" button and select one of the example. Click "upload" then you will see the new pictogram shown. You can now add more pictogram by clicking "Add Diagram" or change the attributes of the pictograms.
Main Features:
- Multiple independent pictograms.
- Move the pictogram by click and drag.
- Resize the pictogram by modifying the width and heigh in the editor.
- All the pictograms are just JSON object. All the app do is to render the object on the canvas.
- Because everything is JSON, everything can be saved as a JSON file. And you can restore the session afterward, even after you have restarted your computer.
- Because of the seperation of object descsription and object rendering, you can easily extend the app to render other object. For example, you can easily add more shapes to the icon.
TODO:
- Social Media Integration (A server needed to be setup).
- A way to delete the pictogram (Now we can only add more pictogram).
- Better UI (less editing on the editor area, more direct editing on the canvas).
- index.html : the main html file that provides the general layout.
- main.css : all the css rules are here.
- main.js : contains all the rendering logic.
- js/editor.js : everything about the editor area.
- js/handlers.js : all the event handlers.
- js/utilities.js : all the utilities functions.
- example/ : example pictograms to be loaded.
