reuters-graphics / bluprint_graphics-kit

SvelteKit rig for graphics and newsapps
https://reuters-graphics.github.io/docs_graphics-kit/
21 stars 3 forks source link

Rig updates #26

Closed MinamiFunakoshiTR closed 3 years ago

MinamiFunakoshiTR commented 3 years ago
hobbes7878 commented 3 years ago

Looks good, but a couple thoughts.

I like the new charts, but I think we want to keep the boilerplate folks have to clear out when they start a new project to a minimum. I'd propose replacing the parliament chart with your barchart component, which is the most simple to read with default props. We can rename that current component to Chart.svelte replacing the parliament chart and have that be the only demo chart on the page when someone starts up.

This PR also touches on a couple other things I've been wondering about, like whether we want to update chart modules to d3 > 7.0 so we don't have to bundle both 6.0 and 7.0 in projects going forward. But we also need not hold up the basic changes in here for that. Just thinking we ticket ToDos to bump to d3 7.0. (Assuming the snowpack rig those modules are demo'd in will handle 7.0 better than Vite initially did.)

And lastly, one last request, I'd like to go ahead and wire the publish time into our headline component. So it should look something like this, I imagine:

<script>
import { apdate } from 'journalize';
import { Headline } from '@reuters-graphics/graphics-svelte-components';
</script>

<Headline section="{content.Kicker}" hed="{content.Hed}" dek="{content.Dek}">
    <span slot="byline">By {content.Byline} </span>
    <span slot="dateline">
      Published <time datetime="{new Date(content.publishDate).toISOString()}">
        {apdate(new Date(content.publishDate))}
      </time>
    </span>
 </Headline>
MinamiFunakoshiTR commented 3 years ago

Sounds good re: making the bar chart the default, rewriting the Publish line, and making a to-do ticket for the d3 versioning

MinamiFunakoshiTR commented 3 years ago

Pushed all the changes mentioned above.

Do we want to add a new slot for the updated dateline in the component? Right now, I have just the published dateline but it might be nice to add the updated dateline as a comment.

`

<span slot="byline">By {@html content.Byline} </span>

<span slot="dateline">
  Published <time datetime="{content.Published}">
    {apdate(new Date(content.Published))}</time
  >

</span>

<!-- Add new slot for Updated dateline? -->

`