0.2.25 • Published 4 months ago

do_graphs v0.2.25

Weekly downloads
-
License
MIT
Repository
-
Last release
4 months ago

Introduction

Do Graph is an open source package used to build/create/design dynamic graphs for your react project.

Installation

npm i do_graphs --save

Components

  1. CustomDashboard: Dashboard to display and create list of dynamic chart pages.
  2. LayoutPages: Page layout design using in-built charts and configure as per your requirement.
  3. Layouts: View Dynamic created pages in your app. Use this component in your root/main file i.e, App.js.

Functions

  1. getRoutLists: Fetch dynamic pages and list it using CustomDashboard component.
  2. getMenuList: Fetch dynamic menu and list it using CustomDashboard component.

Props

  1. CustomDashboard: a. routeBackendUrl: (mandatory) backend url of list of dynamically created route pages. b. isMenuLayoutPresent: (mandatory) true if your app has side menu bar. c. headers: (optional) API headers.

  2. LayoutPages: a. routeBackendUrl: (mandatory) backend url of list of dynamically created route pages. b. menuBackendUrl: (mandatory) backend url of list of dynamically created menu. c. frontendUrl: (mandatory) frontend url of your application. d. headers: (optional) API headers.

Implementation

Use Layouts component in your App.js file to add dynamically ceated pages in your app. Example:

import { RouteContext, getRoutLists, getMenuList, Layouts, CustomDashboard, LayoutPages } from 'do_graphs';

const App = () => {
    const [routePages, setRoutePages] = useState([])
    const [menu, setMenu] = useState([])
    const getRoutes = async () => {
        const result: any = await getRoutLists(backendUrl, config) // return the list of pages from backend
        setRoutePages(result)
    }
    const getMenus = async () => {
        const result: any = await getMenuList(backendUrl, config) // return the list of menu from backend
        if (result?.length > 0) {
            setMenu(result)
        } else {
            setMenu([])
        }
    }
    useMemo(() => {
        getRoutes()
        getMenus()
    }, [])
    return (
        <RouteContext.Provider value={{ routePages, setRoutePages, menu, setMenu }}>
            <Route path={'/custom_layout'} element={<CustomDashboard routeBackendUrl={routeBackendUrl} isMenuLayoutPresent={isMenuLayoutPresent} headers={headers} />} />
            <Route path={'/layout/:id'} element={<LayoutPages routeBackendUrl={CustomRouteUrl} menuBackendUrl={CustomMenuUrl} frontendUrl={Frontend} headers={headers} />} />
            {routePages?.length > 0 && routePages?.map((it: any, n: number) => (
                <React.Fragment key={n}>
                  <Route path={it.path} element={(<Layouts title={it?.title} html={it?.element} menuId={it?.menu_id} />)} />
                </React.Fragment>
            ))}
        </RouteContext>
    )
}

export default App;
0.2.25

4 months ago

0.2.24

5 months ago

0.2.23

5 months ago

0.2.22

5 months ago

0.2.21

5 months ago

0.2.20

5 months ago

0.2.19

5 months ago

0.2.18

5 months ago

0.2.17

5 months ago

0.2.16

5 months ago

0.2.15

5 months ago

0.2.14

5 months ago

0.2.13

5 months ago

0.2.12

5 months ago

0.2.11

6 months ago

0.2.10

6 months ago

0.2.9

6 months ago

0.2.7

6 months ago

0.2.8

6 months ago

0.2.1

7 months ago

0.2.0

7 months ago

0.2.6

7 months ago

0.1.100

7 months ago

0.2.3

7 months ago

0.2.2

7 months ago

0.2.5

7 months ago

0.2.4

7 months ago

0.1.97

8 months ago

0.1.98

8 months ago

0.1.99

8 months ago

0.1.96

9 months ago

0.1.95

9 months ago

0.1.91

9 months ago

0.1.92

9 months ago

0.1.93

9 months ago

0.1.94

9 months ago

0.1.90

9 months ago

0.1.87

9 months ago

0.1.88

9 months ago

0.1.89

9 months ago

0.1.86

10 months ago

0.1.85

10 months ago

0.1.84

10 months ago

0.1.83

10 months ago

0.1.82

10 months ago

0.1.81

10 months ago

0.1.80

10 months ago

0.1.79

10 months ago

0.1.78

10 months ago

0.1.77

10 months ago

0.1.76

10 months ago

0.1.75

10 months ago

0.1.74

10 months ago

0.1.73

10 months ago

0.1.72

10 months ago

0.1.71

10 months ago

0.1.70

10 months ago

0.1.69

10 months ago

0.1.68

10 months ago

0.1.67

10 months ago

0.1.66

10 months ago

0.1.65

10 months ago

0.1.64

10 months ago

0.1.63

10 months ago

0.1.62

10 months ago

0.1.61

10 months ago

0.1.60

10 months ago

0.1.59

10 months ago

0.1.58

10 months ago

0.1.57

10 months ago

0.1.56

10 months ago

0.1.55

10 months ago

0.1.54

10 months ago

0.1.53

10 months ago

0.1.52

10 months ago

0.1.51

10 months ago

0.1.50

10 months ago

0.1.36

10 months ago

0.1.35

10 months ago

0.1.34

10 months ago

0.1.33

10 months ago

0.1.32

10 months ago

0.1.31

10 months ago

0.1.30

10 months ago

0.1.29

10 months ago

0.1.28

10 months ago

0.1.27

10 months ago

0.1.26

10 months ago

0.1.25

10 months ago

0.1.24

10 months ago

0.1.23

10 months ago

0.1.22

10 months ago

0.1.21

10 months ago

0.1.20

10 months ago

0.1.19

10 months ago

0.1.18

10 months ago

0.1.17

10 months ago

0.1.16

10 months ago

0.1.15

10 months ago

0.1.14

10 months ago

0.1.12

10 months ago

0.1.11

10 months ago

0.1.10

10 months ago

0.1.9

10 months ago

0.1.8

10 months ago

0.1.7

10 months ago

0.1.6

10 months ago

0.1.5

10 months ago

0.1.4

10 months ago

0.1.3

10 months ago

0.1.2

10 months ago

0.1.1

10 months ago

0.1.0

11 months ago