No description, website, or topics provided.
JavaScript HTML CSS Python Other
Latest commit 409b75f Feb 21, 2017 @thehandsomepanther thehandsomepanther committed on GitHub Merge pull request #348 from thehandsomepanther/map-attribution
support attribution on custom maps
Permalink
Failed to load latest commit information.
AWS_Hosting Added some clarifications re team suggestions Nov 2, 2016
BEST_PRACTICES Added best practices documentaiton Nov 2, 2016
GITHUB_HOSTING i wish i knew how to quit <br> tags Oct 26, 2016
compiled Merged attribution changes Oct 10, 2014
core Add single-user test mode Sep 2, 2016
deploy git-deploy 1.0.4 Aug 12, 2016
libs proxy safari and msie 7/8/9; remove trailing commas form language files Jun 24, 2014
robot_tests Fix conflicts in robot tests. Oct 3, 2016
s3analysis added url stuff Oct 6, 2016
source support attribution on custom maps Feb 9, 2017
static support attribution on custom maps Feb 9, 2017
storymap fixes modular TEST_MODE settings reference for optional test mode env… Oct 12, 2016
templates support attribution on custom maps Feb 9, 2017
website/less Use adhoc ssl context instead of bogus self-signed certificate Sep 24, 2015
zoomify created readmefile Oct 24, 2016
.gitignore Add 'fab test' task to run Robot Framework tests Sep 25, 2016
CHANGELOG Adds 0.6.2 date to changelog Dec 13, 2016
LICENSE Added license Dec 18, 2013
README.md Adds userinfo endpoint in troubleshooting section of readme Oct 11, 2016
api.py Merge pull request #337 from NUKnightLab/fix-311 Dec 13, 2016
codekit-config.json Cleanup Jul 19, 2014
config.codekit Merged attribution changes Oct 10, 2014
config.json Removed unused config.json b.s. Feb 27, 2015
deployment.md Removed outdated site deployment instructions Jul 8, 2015
env.sh.example adds debug to env.sh example Jul 15, 2016
fabfile.py Clean Robot log directory before running tests Sep 25, 2016
js-requirements.txt try to clarify instructions for javascript development. Apr 5, 2016
render.py Add scripts to re-render embed pages Jun 1, 2015
render_prd.sh Add scripts to re-render embed pages Jun 1, 2015
requirements.txt mongomock 3.5.0 is 404 - update to current version from pip search Oct 4, 2016

README.md

StoryMapJS: Maps that tell stories.

StoryMapJS is a simple tool to help you tell stories with maps. If you're not a programmer, you don't need to spend much time on the GitHub page—instead, go StoryMapJS

If you want information on creating JSON with your own code and embedding it, see the "Advanced" documentation on the StoryMap website.

The rest of this document gets into a few technical details that some folks might want.

Contributing translations for new languages

StoryMap's older sibling, TimelineJS has proven internationally popular, in part because users have contributed translation support for dozens of languages. StoryMap is also ready to be used in languages other than English, but once again, we'll need your help.

For each language, we need a simple file with a name like *xx*.js, where xx is the two letter code for the language. (Technically, it's the ISO 639-1 code—you can find a list of them on Wikipedia.) The file defines a Javascript object with language specific translations. To make one for your language, copy one of the existing files (like this one for Spanish) and edit the quoted strings. Please don't change the "keys"—the unquoted strings. If you know how to use GitHub to make a pull request, that's the best way to submit it to us. If that's not your thing, you can add a comment to this support thread and upload your translation as an attachment.

GigaPixel

Images are rendered so when set to be map_as_image the entire image is shown. When set as cartography the zoom will set so that all the markers fit.

Points are set to only display on mouseover in image mode, but you can set map_as_image to false in the config options to always show the points. The points are hidden when the intent is an image so that nothing obstructs the image the viewer is looking at. Looking at a painting is hard with a bunch of points on it.

Map Options

To disable connecting lines on maps use the StoryMap options: "Treat as Image" (as opposed to the default, "Treat as Cartography"

More config options available to do what you want with the line:

line_follows_path:      true,       // Map history path follows default line, if false it will connect previous and current only
line_color:             "#c34528",,
line_color_inactive:    "#CCC",
line_join:              "miter",
line_weight:            3,
line_opacity:           0.80,
line_dash:              "5,5",
show_lines:             true,
show_history_line:      true,

To disable zoom calculation/edit zoom level set calculate_zoom to false in the config options.

Images can now be used in place of map pins. Use image inside the location object and include a url to use. use_custom_markers also has to be set to true in the story map options. Same goes for custom icons except you need icon inside the location object and include a url to use.

Setting up a development environment

In order to stay consistent with other kinds of deployment tools, we use python and Fabric to build and deploy StoryMapJS. However, if you are comfortable using CodeKit, you can use it also: the rules for assembling the various files into a single final storymap.js are specified using CodeKit's syntax.

If you don't use CodeKit, you must have Python installed. We use python 2.7.

Clone our fabfile repository and place it in the same parent directory as your StoryMapJS respository.

Install virtualenv, virtualenvwrapper, and MongoDB.

If you need to run the server, copy env.sh.sample to env.sh and, if necessary, modify any values in it. Execute this script with source env.sh when you are working on StoryMapJS, or otherwise arrange for these environment variables to be set. There are a number of environment variables which are critical to running the server which involve Amazon Web Services and Google Application credentials which we do not store in GitHub. If you are at Knight Lab, see a staff developer for these values. If you are outside of Knight Lab, you may not

# Create a virtual environment
mkvirtualenv storymapjs

# Activate the virtual environemnt
workon storymapjs

# Install python requirements
pip install -r requirements.txt

Developing StoryMapJS - the javascript

If you are interested in contributing to the development of the StoryMapJS javascript library, that is about it. When you make changes to the code, you should execute the fab build command. (Be sure you have activated the virtual environment.) To test your changes, run a simple local web server with build as the document root. You can test your local work by loading a URL like this (assuming your local server runs on port 8080):

http://0.0.0.0:8080/embed/index.html?url=http://media.knightlab.com/StoryMapJS/demo/sochi.json

You can change the URL to other examples. You can generally find the JSON for a StoryMap you've published by taking the StoryMap's direct URL and changing index.html to published.json.

As you work, don't forget to run fab build each time you make changes. When time allows, we hope to make this automatic, but we haven't budgeted the time yet.

Developing StoryMapJS - the authoring environment

StoryMapJS's authoring environment is rather more complex, and the instructions here are primarily directed at people who are directly involved with Knight Lab. The effort to make it easier for outside developers to contribute to this is higher than we can afford for the moment.

You must have MongoDB installed and running. You must copy the env.sh.example file to env.sh and edit the values accordingly. Specifically, there are a number of environment variables for access to outside services which do not belong in GitHub. Get those from a Knight Lab staff developer.

Be sure to execute env.sh every time you want to run the StoryMapJS server. An easy way to do that is using the virtualenvwrapper postactivate hook.

Once you've established the necessary environment variables, you should be able to...

# Run the development server
fab serve

Files located in the source directory are assets for storymapjs itself. The core Flask app which controls the server is api.py which uses library code in the storymap directory. The pages you see are built from files in templates.

At this time, edits to the HTML for the website are automatically visible when reloading the local server. Edits to CSS and JavaScript must be manually compiled before you'll see them. Run fab build. This is something we'd like to make more automatic eventually.

A note about installing python requirements on Mac OS X 10.11 "El Capitan"

Apparently, Apple removed support for openssl in Mac OS X 10.11. Here's the solution we've found.

  • brew install openssl
  • CFLAGS="-I$(brew --prefix openssl)/include -I$(xcrun --show-sdk-path)/usr/include" LDFLAGS="-L$(brew --prefix openssl)/lib" pip install -r requirements.txt

Troubleshooting

Users may be directed to our userinfo page to help with troubleshooting. This page provides information about the user's account and saved storymaps. The endpoint is https://storymap.knightlab.com/userinfo/