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

breakdown of mvc model #3

Open
siddht4 opened this issue Sep 24, 2019 · 2 comments
Open

breakdown of mvc model #3

siddht4 opened this issue Sep 24, 2019 · 2 comments

Comments

@siddht4
Copy link

siddht4 commented Sep 24, 2019

@beefoo Your project /visualization is really awsome.

So can you provide me with cheatsheet or listing of all your mvc model so that I can refactor it properly without leaving out the important bits and to update to latest d3 v5 . Subsequently also removing jquery, backbone for easier implemantation

@siddht4
Copy link
Author

siddht4 commented Sep 24, 2019

As far as I have checked

jquery , underscore and backbone are essential

d3 is the core (obviously) .

config.js ,helper.js and app.js is to structure the code aka module and controller of your mvc app

transit.show.js is view aka output / viz handler of your mvc app.

util.js is a handler to properly structure DOM handler aka view of your mvc app but not required

Rest are just additional handler for your app

So for a smooth refactoring I would like to get the cheatsheet of your app

I have tried to single the app at my mod

Can you mention which source to be mentioned , this repo or memoryunderground.com page or far better both

@beefoo
Copy link
Owner

beefoo commented Nov 12, 2019

Apologies for the delayed response as I don't get notifications for this repository and its been a while since I touched this code. Not sure if it's still useful, but yes, as you mentioned, d3 is the most important bit for this since it handles the rendering of the SVG lines, circles, and text; the rest can be implemented however else you see fit.

The core logic of how the data is structured and rendered can be found in these two files:
https://github.com/beefoo/memory-underground/blob/master/assets/js/models/transit.js
https://github.com/beefoo/memory-underground/blob/master/assets/js/views/transit.show.js

And a sample data file here:
https://github.com/beefoo/memory-underground/blob/master/data/sample.json

  • As you can see here, a transit object has a list of station objects and line objects.
  • A line has multiple stations, and a station can be associated for one or more lines.
  • The models/transit.js file provides the logic for reading, parsing, and writing the .json file
  • The transit.show.js file contains all the logic for rendering the map with D3

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

2 participants