Git Product home page Git Product logo

vizwiz's Introduction

vizwiz

A data visualization widget library

Vizwiz contains several widgets to help with data vizualization. They are meant to work together, communicating via custom JavaScript events.

Build Setup

# install dependencies
yarn install

# serve with hot reload at localhost:8080
yarn run dev

# build for production with minification
yarn run build

# build for production and view the bundle analyzer report
yarn run build --report

# run all tests
yarn test

# Run the documentation server at localhost:3000
yarn run docs

vizwiz's People

Contributors

coordt avatar fionawhim avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vizwiz's Issues

Rename `showDataLayer` JSON attribute

The showDataLayer attribute in the config JSON should be renamed to addressSearchPopupDataSourceUid.

It would not be unreasonable to rename other search-related attributes to start with “addressSearch”

Configure polygon style or icon for legend

When displaying the legend, the <cob-map> component needs to know if it should show the polygon info or the icon.

Currently the vizwiz configuration sets both polygon style and icon style in all cases.

We need a way to make it clear what should be used in the legend. Currently if there's an icon, the legend shows that, otherwise it shows a polygon.

For the city council map, we can change it to show a polygon if it's specified, then fall back to an icon if it's not.

For food trucks, which has markers, there will need to be some way to tell the legend to use the icon, either through specific configuration or by allowing the polygon style to be "none."

Fix Schema v1 output

A few things that diverge from the v1 schema.

Schema docs: https://cityofboston.github.io/vizwiz/vendor/docson/#../../schema/viz-1.0.schema.json

  • title and description are on the top-level config. They should be sent as title and instructionsHtml inside the first map object.
  • type should move from dataSource to inside its data object.
  • popupHtmlTemplate doesn’t have a value, even when one is put in the textbox in the data source edit dialog
  • legend on the dataSource is an empty string, rather than a LegendStyle object

Colors options for lines/polygons

For lines and polygons we should start with giving content editors only a few options so we can keep consistency in look and feel throughout the maps on boston.gov

When we have had multiple colors on a map this in the past, we have stuck to the main brand colors, so in the drop down for "Layer Style" under "Data Style" when the data type is line or polygon lets put:

  • Charles Blue (hex: #091F2F, rgb: (9,31,47))
  • Freedom Trail Red (hex: #FB4D42, rgb: (251,77,66))
  • Optimistic Blue (hex:#288BE4, rgb:(40,139,228))

with the name of the color and small previews of each so users know what they are selecting.

Add a filter editor component to vizwiz

  • Check box "Include Filter"
    • Initially clicking on it should show the edit filter dialog
    • Saving the filter show show the check box as checked, and have an "Edit" button next to it
    • Clicking on the edit button will open the edit filter dialog with the appropriate values
  • Edit Filter dialog should have the ability to select which of the created data sources it will filter
  • Selecting a data source will list the fields and allow one to set which fields to filter

Update default map coordinates to 42.3200, -71.1284.

Because the majority of maps are city-wide, we should set the default coordinates for maps created through vizwiz to: 42.3200, -71.1284 and keep the zoom defaulting to 12 for initial iterations of the tool.

"fill" value for data source polygonStyle

The <cob-map> component distinguishes between vector layers that are filled in and those that are just lines. (The legend rendering is different, for example.)

Whether a polygonStyle is for a line or a filled region should be included in the configuration JSON.

For city council, since it's just regions, we can default on the <cob-viz> side to assuming that all data sources are filled. We'll just need to fix this before we do the snow map.

Need to decide JSON configuration

Need to decide on how we'll set up the JSON this web component will produce so we can properly parse it in the pattern library and future web components.

Did a little research on what other folks are doing:

  • ArcGIS web map specification has detailed documentation. They have far more options than we need, but below are the high level sections they have that we could have a use for based on features need in our MVP:

    • applicationProperties is where they store information about the Address search and Finding user location
    • operationalLayers, specifically their notes about Feature Layers, which is what we pull from ArcOnline for data, is where information like the item url, popup information, and filters
    • they also have a high level table object that could be good for future use
  • Carto visjson configuration is seemingly less complicated with most of the same inputs as above so may be a good place to start?

Thinking we could probably lift elements from both of these specifications - hoping these docs give us a good place to start.

Data source not appearing in "show data from layer"

I added a layer but it does not appear in the list of layers you can choose for address search.

Repro:

  1. Visit http://vizwiz.boston.gov.s3-website-us-east-1.amazonaws.com/
  2. Press "Add Item"
  3. Choose City_Council_Districts from the available data sources dropdown
  4. Press "Save"
  5. Click the "Include Map" checkbox (edit dialog appears)
  6. Click the "Search for an address" checkbox

What you should see:

The City_Council_Districts data source should be in the "show data from layer" dropdown.

What you do see:

The dropdown is empty.

screen shot 2018-03-21 at 5 03 14 pm

At least once I've seen the dropdown populate, but I don't know what workflow caused that. I've reproduced with the above steps a few times now.

Raw HTML option for popover template

For the city council map, we need the following popover template:

<img src="{{Image}}"
  class="cdp-i"
  alt="{{Councilor}}"
  style="margin-bottom: 1rem" />
<div class="ta-c m-v300">
  <div class="cdp-t t--sans t--upper m-t200">{{Councilor}}</div>
  <div class="cdp-st t--subinfo t--g300">District {{DISTRICT}}</div>
</div>
<a href="{{Bio}}"
  class="btn btn--b btn--100 btn--sm">
  Visit webpage
  <span class="a11y--h"> of {{Councillor}}</span>
</a>

Currently the data source dialog has a rich text editor for the popover template, so pasting raw HTML ends up showing up literally.

screen shot 2018-03-21 at 4 30 16 pm

For the city council milestone, the editor should have a way to specify the raw HTML of the popover template.

screen shot 2018-03-21 at 4 32 38 pm

Zoom and lat/lng in map options

For the city council map, we want to specify a default zoom of 12 and a lat/lng of 42.3200, -71.1284.

Currently there is no configuration for these options (though the zoom seems to default to 12).

screen shot 2018-03-21 at 4 52 58 pm

Normalize vizwiz configuration schema

If a JSON value should be interpreted as HTML, then its key should make that obvious. E.g. descriptionHtml and popoverHtmlMustache. Other keys that are just strings should stay the same (such as "title")

Putting this above the milestone only because migrating the config will be more of a pain once we're in the wild.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.