Friday, April 22, 2022
HomeBusiness IntelligenceGoodData CoreUI Integration | GoodData

GoodData CoreUI Integration | GoodData


There’s a wealth of open-source HTML bootstrap templates for analytics, and discovering the choice that most closely fits your wants is a vital job that takes time. Nevertheless, you possibly can solely see the true worth of every template whenever you plug in precise information beneath. So we requested ourselves:

What does it take to interchange dummy template information with real-time interactive analytics powered by GoodData?

Let’s discover out.

Analytics HTML Web site Templates

To decide on the perfect template, you will have to think about many various components, however it’s best to all the time begin by asking your self the query: Who’s my typical buyer? As soon as you understand the reply to this, you possibly can proceed to reply the questions beneath:

  • What’s the license?
  • Is the template up-to-date and well-maintained, with a group behind it that may provide assist?
  • Does it comprise the varieties of visualizations I will be needing most?
  • Will it work on a desktop in addition to on a pill or cellphone?
  • Does it come solely in plain HTML, or does it additionally include out-of-the-box help for JSX (React), Handlebars (Ember), or one other language?

For this train, we determined to go along with CoreUI, particularly CoreUI for React.js. To set it up, let’s simply peek into CoreUI’s README:

# clone the repo
$ git clone https://github.com/coreui/coreui-free-react-admin-template.git my-project

# go into app's listing
$ cd my-project

# set up app's dependencies
$ yarn set up // or npm set up

And that is the way it appears recent out of the field:

CoreUI integration image

What’s fallacious with it? Completely nothing, besides… it reveals dummy information! So let’s go forward and exchange the hard-coded numbers with some actual analytics.

Earlier than We Start

GoodData is a safe platform that requires correct authentication to entry the analytics. Nevertheless, for the simplicity of this train, we’re going to connect with an uncovered dummy workspace that doesn’t require any technique of authentication.

Import GoodData.UI

Now let’s navigate to the supply code of CoreUI for React.js and add GoodData.UI as a dependency:

# inside my-project folder
$ yarn add @gooddata/sdk-backend-base @gooddata/sdk-backend-bear @gooddata/sdk-model @gooddata/sdk-ui

The GoodData platform is just accessible by way of secured HTTPS, so we have to inform that to react-scripts by updating package deal.json accordingly:

# /package deal.json

-    "begin": "react-scripts begin",
+    "begin": "HTTPS=true react-scripts begin",

Notice: In case you are utilizing Home windows (cmd.exe), use set HTTPS=true&&npm begin as a substitute. For extra data, see the Create React App web page.

The final modification wanted is to create a gooddata.js config file within the /src folder:

import bearFactory from '@gooddata/sdk-backend-bear'
import { AnonymousAuthProvider } from '@gooddata/sdk-backend-base'

const backend = bearFactory({
  hostname: 'https://interactive-examples-proxy.herokuapp.com/',
}).withAuthentication(new AnonymousAuthProvider())

export default backend

That is it! All of the configuration wanted is finished, so now is an effective time to restart the localhost improvement server. If it is nonetheless working, cease it with CTRL+C, then restart it by working:

$ yarn begin // or npm begin

Let’s now transfer on to rendering our first visualization!

Render a KPI

To render a KPI, let’s begin by navigating to /src/views/Widgets/WidgetDropdown then importing GoodData.UI and the configuration we created earlier to the start of the file:

# /src/views/Widgets/WidgetDropdown.js

import { Kpi } from '@gooddata/sdk-ui'
import { newMeasure } from '@gooddata/sdk-model'
import gooddata from './../../gooddata'

Now let’s choose a pleasant place to place our first Headline element and add the next line:

<Kpi
  backend={gooddata}
  workspace="psk46untnn2vhzs5bokdav3bu2puf6s6"
  measure={newMeasure('abljxJ9HatLT')}
/>

Notice: The “abljxJ9HatLT” identifier represents the “Complete Income” metric that exists in our demo workspace. We hardcoded it right here that will help you get began shortly. In the event you don’t love magical constants in your code, chances are you’ll need to take a look at our Catalog CLI device.

Since CoreUI for React comes with a server sizzling reloading function, as soon as the Dashboard.js file is up to date and saved, it’s best to see your app mechanically refresh to replicate the brand new adjustments:

CoreUI integration image

Double-check that you simply’re working on HTTPS, and never HTTP! You must see that the primary KPI in your display screen is now stay and that its formatting is completely different from different KPIs — the comma is used as a delimiter as a substitute of a dot.

Abstract

Effectively, that was it! You could find the consequence at: https://github.com/gooddata/gooddataui-coreui-example/tree/article.

Wish to see for your self how fast and straightforward it may be? Get began free of charge, create some insights from our library of visualizations, and design your first dashboard! And to kickstart your GoodData analytics expertise, join our GoodData College course.

RELATED ARTICLES

7 COMMENTS

  1. Özellikle aktarlarda satılan bir çok gıda takviyesi
    bulunmaktadır. Bunlardan biri olan fx15 içeriği de oldukça merak uyandırmaktadır.
    Web de yer alan bilgilere baktığınız zaman içeriğinde Çinko (4 mg), C vitamini (30 mg), Üzüm Çekirdeği Eksresi (10 mg), ikro
    Kristalin Selüloz (98 mg) bulunduğu bilgisini görebilmektesiniz.
    Ürün doğal bir gıda takviyesi olarak geçse de yine
    de kullanmadan önce hekiminizden bilgi almanız gerekmektedir.

    fx15 içeriği

  2. The person can use both equally android products and PCs
    to have entry to these websites. The person can choose from
    the free and top quality ones anytime since the paid out
    ones should have
    Free Generator | Code And Key Online Generator Free Codes
    free generator

  3. gradient generator causes it to be effortless to develop modern day, blurry gradients.
    Insert any two hues and randomize for getting a different gradient composition each and every time.

    Free Generator | Code And Key Online Generator Free Codes
    free generator

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments