Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I built a <a href="https://github.com/Aldaviva/floorplan" rel="noreferrer">floorplan application</a> that sounds similar to what you're creating. Feel free to look at the source code and create your own fork. Hopefully you can pull some inspiration from it.</p> <p>The code most relevant to SVG manipulation is <a href="https://github.com/Aldaviva/floorplan/blob/master/public/scripts/Map.js" rel="noreferrer">Map.js</a>, so you may want to start there. One of the map SVGs is stored in <a href="https://github.com/Aldaviva/floorplan/blob/master/views/maps/mv.svg" rel="noreferrer">mv.svg</a>.</p> <p>Sadly, I can't point you to the live instance this is running on because it's on an internal HR server.</p> <h2>Architecture notes</h2> <ul> <li>walls and room names are stored in an SVG file. <ul> <li>generated in Adobe Illustrator, which can import AutoCAD DWG</li> <li>SVG edited by hand to include a JavaScript array of seat coordinates</li> </ul></li> <li>on page load, server-side templating inserts the SVG into the HTML source <ul> <li>otherwise, if SVG is loaded using an <code>&lt;object&gt;</code> or <code>&lt;image&gt;</code> tag or CSS <code>background-image</code>, you won't have access to the SVG DOM through JavaScript</li> </ul></li> <li>dynamic data (meetings, seats) are retrieved from a Mongo database and exposed through a JSON REST API</li> <li>a client-side JavaScript MVC application uses Backbone to insert the dynamic data into the SVG DOM and attach event handlers <ul> <li>when a person's avatar is clicked, detailed person info is shown</li> <li>when the user types in a search box, the avatars in the SVG get CSS classes applied so avatar images that don't match the search are semi-transparent</li> </ul></li> </ul> <h2>Database schema</h2> <p>The Mongo database has a <code>people</code> collection, each of which contains a document of the following form:</p> <pre><code>{ "_id" : ObjectId("5201db41f5f4be9ae57e37a9"), "fullname" : "Ben Hutchison", "desk" : 3, "office" : "mv", "email" : "ben", "title" : "Software Engineer, Graphic Designer", "tags" : [ "des", "eng" ], "linkedInId" : 139463329, "mobilePhone" : "845-986-0123", "workPhone" : "408-550-2995" } </code></pre> <p>The only required field is <code>fullname</code> (and <code>_id</code>, but I let Mongo autogenerate that).</p> <h2>Configuration</h2> <p>You can configure the database connection and HTTP server settings by copying the provided <code>config.json.example</code> to <code>config.json</code> and making your changes in the new file.</p> <h2>Screenshot</h2> <p><img src="https://i.stack.imgur.com/64bSn.jpg" alt="screenshot"></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload