Coder Social home page Coder Social logo

coral-ask-election-2016's Issues

Generic id may cause integration edge case issues

The script embed locks onto a div with id main:

<div id="root"></div><script type="text/javascript" src="./static/js/main.76efbf97.js"></script>

Many sites will have an element id="root". If so, it is likely that this interactive will take over the page in an unexpected way.

Order Filter by Topic issues by % of responses

Request from The Washington Post graphics team:

On the Filter by Topic section, Please order the topics by percentage of responses, with the top vote-getter at the top of the list and the lowest vote-getter at the bottom of the list.

Reason: it'll make the results more easy for users to compare.

Broken styles in IE10

image

For some reason the emoji image tags are being given a width and height in IE10,
image
presumably derived from the "natural" 150px height of the linked SVG image.

Additionally, the buttons are no longer receiving their proper styling because display: table-header-group opts the <button> out of more display rules in IE10 than in newer browsers. Wrapping the button in a div and setting that display rule on the div instead of the button will resolve the issue.

Deployment Questions

  • Do we create a custom build for each site, with configuration options built in to the bundle; or do we have an editable side-car file like config.json which can be edited on a per-site basis, and deploy the same bundle to all sites which will consume that for config?
  • What is the latency on loading editorial text from google docs? What is the overhead on using a script to take that sheet and save it out as a code file to be hosted on S3, to reduce latency? Is that something that is within the capabilities and purview of a newsroom?
    • is there an opportunity to add content-editable areas within Coral, instead, that could be used to enter that data, and then surface that through a separate export feed?

Content needed for the interactive:

  • title for interactive
  • intro text
  • address of coral installation/form embed (if not embedded separately)

Webpack warning on Tabletop library

Including tabletop triggers this warning:

Warning in ./~/tabletop/src/tabletop.js
Critical dependencies:
7:18-43 the request of a dependency is an expression
 @ ./~/tabletop/src/tabletop.js 7:18-43

Background on that error: webpack/webpack#196

Going to revisit this after app is fully working to determine if build needs to be somehow optimized, that thread makes it sound like we may be bundling code unnecessarily due to this issue.

Update sample data to have right emoji & issues list

πŸ˜πŸ˜€πŸ˜πŸ˜ŸπŸ˜‘πŸ˜³πŸ˜žπŸ€” πŸ‡ΊπŸ‡Έ

Cybersecurity, the economy, trade, education, energy and the environment, health care, crime, defense and national security, immigration, foreign policy, social issues

Define JSON schema

This issue can serve as a place where @jde & I can toss JSON snippets back and forth to hammer out a good export format

Order of styles in generated CSS is unintuitive

While working on #118 @pbeshai & I noticed that the generic styles, such as h1, .btn etcetera, are rendered at the bottom of the CSS file; this means they actually override the more-specific styles like .form-toggle-button higher up in the document. This is unintuitive, because it means an integrator would have to not only change the definition of .form-toggle-button, but also re-order that rule to the end of overrides.css should they wish to alter the appearance of their document (as the two classes have the same CSS precedence, so the latter one wins).

I am investigating how we can change the order of our imports so that the generic styles end up going first.

Form re-renders emojis

emoji_re-render-issue

Currently we have:

    // also re-emojify on click
    allLabels.on('click', () => {
      // re-emojify all nodes
      allLabels.nodes().forEach((node) => {
        twemoji.parse(node, icon => emojiSVGUrl(icon));
      });
    });

This only listens for clicking the emojis. but it looks like the form re-renders every time something changes in the form.... so maybe onChange in the form elements in the fix in EmbeddedAskForm

Consider how to reliably match questions to letter format

As we think about the letter format,

Dear [Secretary Clinton/Mr. Trump],

As you prepare to become president I'm feeling [emoji from 1]. I think your top priority should be [list item from 2]. If you achieve one thing in the next four years, I want it to be: [short answer from 3].

Thank you and good luck.

[name from 4], [location from 5]

I think we may need to talk about what we have to assume about how "locked-down" our form is, or else find some way next week to embed this editorial text into the ask form back-end; because I can infer data charts from the data regardless of question order, but I can't compose a letter with fixed interstitial text if they re-order or change the questions

something to think about

Embed form in vis

  • Drive rendering of bubble chart from React
  • Use <button> elements for bubble chart containers
  • Make API configurable
  • Get data rendering from Google Sheets
  • Get letter rendering below bubble chart, filtered by bubble chart
  • Connect emoji graph to topic bar chart filters
  • Get letter rendering below topipc bar chart, filtered by bar charts
  • Embed form
  • Make form collapsible

Fix layout and click-blocking of percentage labels on bubble chart

The span tags overlap the other images; I can scale down the emoji to make them fit in the circle, but I'm investigating z-index and other tricks to ensure that the emoji themselves are the forefront clickable element.
image

Percentage label alignment is way off in IE, exacerbating the above problem:
image

Update all paths to use the base path from config

My suggestion to use relative paths wasn't sound. This works when hitting the index file directly on the S3 bucket. When embedding, however, relative paths resolve to the embedded site, not the bucket.

We will be putting the build into a folder called 'coral-ask-election-2016' inside the same place the json files are installed.

Update all paths to use the following base path:

jsonURI + "coral-ask-election-2016/"

screenshot 2016-11-02 12 12 02

Scaffold React app

We need a base react scaffold w/ a build process, hot reloading, linting, the usual. Should we just use create-react-app?

Resolve issue with emoji bubble chart animation

Chrome desktop:
emoji-behavior
And on iPhone:
emoji-behavior-iphone

Provisional approach: Check for a hasRendered state property (per item key?) in React, set this in componentDidUpdate after rendering DOM elements the first time. If this prop is present, don't render the margin from React, so that D3 and CSS behave predictably.

TODO: Get help w/ CSS transitions so that we can have each emoji:

  1. POP in nicely
  2. Zoom quickly on mouseover
  3. Go back to normal on mouseout

Emoji Rendering PoC

  • Can we render emoji in plain text on different platforms/devices (Android, iOS, FireFox, etc)
  • Can we render emoji in <text> elements in SVG, and size them arbitrarily?

Once we have a form sample,

  • Can the form actually be used to pose a question w/ emoji responses?

Choosing a topic that doesn't have entries will result in an error

image

Click on crime

Because of this action.js

function shouldFetchResponses(state, answerId) {
  var _state$responses = state.responses;
  var collections = _state$responses.collections;
  var isFetching = _state$responses.isFetching;

  return !collections[answerId].length && !isFetching[answerId];
}

There is no collections[answerId] entry

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.