Git Product home page Git Product logo

graphql-plot's Introduction

graphql-plot

A Kotlin GraphQL Client/Server architecture using Lets-Plot inside a Kotlin Multiplatform (JS) environment.


This version is not developed anymore in favor of a Kotlin Multiplatform version.


Architecture

The GraphQL server makes use of GraphQL Kotlin, which makes possible to define the GraphQL schema dynamically when building the project.

While the server is up and running, the Apollo GraphQL client can introspect the server's schema for generating all the classes which provides type safety at compile time.

While the server is developed and built upon JVM, the client is built inside a Kotlin Multiplatform environment, in particlare, it will be ported to a JS web-based application.

This application will make use of Lets-Plot Kotlin, for displaying in the browser the received data from the server.

In the simple example provided by this applicaiton, the server will generate random 2D Points every 500ms through a graphql subscription. The client that subscribes to this, can specify a number of points to collect, real-time plotting those points in a cartesian plane, and when the collections is finished, drawing a polinomial regression line upon those points collected.

Usage

First of all, run the server with:

./gradlew :server:run

You can also run the server through a docker container (so docker must be installed on the system) running:

./gradlew :server:runDocker

Once the server is started, download the schema with the following Gradle task:

./gradlew :js-app:downloadApolloSchema --endpoint='http://localhost:8080/graphql' \
--schema=./js-app/src/jsMain/resources/graphql/schema.graphqls

Then you can test out the web application using the GrapQL client with:

./gradlew :js-app:jsBrowserRun

If you're making changes to the client application, it could become handy the --continuous flag when running :js-app:jsBrowserRun task, wich let's you recompile and run automatically the web application when you save.

graphql-plot's People

Contributors

s-furi avatar

Watchers

 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.