Giter Club home page Giter Club logo

alphagov / vuejs-json-dashboardify Goto Github PK

View Code? Open in Web Editor NEW
1.0 6.0 2.0 345 KB

Create a client-side VueJS component which reads JSON from a GET endpoint and renders into the GovUK Frontend template dynamically including containers, grid rows headers, content and tables. This is to be used to render dynamic content from a static S3-backed server.

License: MIT License

JavaScript 64.92% HTML 33.04% SCSS 0.88% Dockerfile 1.16%
cyber-security

vuejs-json-dashboardify's Introduction

vuejs-json-dashboardify

Create a client-side VueJS component which reads JSON from a GET endpoint and renders into the GovUK Frontend template dynamically including containers, grid rows headers, content and tables. This is to be used to render dynamic content from a static S3-backed server.

What it looks like

Setup

You can run locally in docker as follows:

docker-compose build
docker-compose run --service-ports demo bash -c "npm run server"
# The demo page should be available on http://localhost:8000

Alternatively you can run locally without docker
npm install and then gulp to load the govuk-frontend and build the css.

Then you can run the code with an npm http server http-server . -a 127.0.0.1 -p 8000

End-to-end tests

I've made a start on some end-to-end tests using nightwatch.

You can run the tests as follows:

docker-compose run demo bash -c "npm run server & npm run e2e"

Invoke the component

Once you've got all the scripts loading correctly you can use the component by just including something like this in your page.

You can see the HTML elements supported in the example file example.json. The only restriction is that the top level component in the JSON has to be a div of some sort.

<json-dashboardify-url-element
    group="unique-within-page"
    source="/example.json">
</json-dashboardify-url-element>

TODO

This is all a bit clumsy at the moment.

I think the next steps are to turn the pe-charts table-chart into a proper VueJS component so it can be included inline.

vuejs-json-dashboardify's People

Contributors

danjoneslf avatar lunarfish avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

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.