Skip to content

feat: create a image slider dataviz #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Sep 1, 2022
Merged

Conversation

andrewizbatista
Copy link
Collaborator

@andrewizbatista andrewizbatista commented Aug 31, 2022

Summary

Added an Image Slider data visualization.

image-slider

Implementation Instructions:

Inject the following script into the index.html to initialize the data visualization.

<script type="text/javascript">
  ((d) => {
    const $body = d.querySelector("body");
  
    if ($body) {
      $body.addEventListener("INITALIZE_IS_READY", ({ detail }) => {
        const initialize = detail?.initialize ?? null;
  
        if (initialize) initialize(JSON_PAYLOAD);
      });
    }
  })(document);
</script>

The payload (represented as JSON_PAYLOAD in the snippet above) should be a JSON string to be parsed into the following type:

type Payload = Array<{
  image: string; // Base64 Image
}>

@andrewizbatista andrewizbatista added the enhancement New feature or request label Aug 31, 2022
@andrewizbatista andrewizbatista self-assigned this Aug 31, 2022
Copy link
Owner

@JoaoLages JoaoLages left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we discussed offline, this PR is good to be merged, great work! 👏
If you want, feel free to add the loading image before displaying the slider, but that can also be done in a future PR or be left as future work.

@andrewizbatista andrewizbatista merged commit 34dfd41 into main Sep 1, 2022
@andrewizbatista andrewizbatista deleted the dataviz/image-slider branch September 1, 2022 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants