0.2.25 • Published 1 year ago

do_graphs v0.2.25

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year 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

1 year ago

0.2.24

1 year ago

0.2.23

1 year ago

0.2.22

1 year ago

0.2.21

1 year ago

0.2.20

1 year ago

0.2.19

1 year ago

0.2.18

1 year ago

0.2.17

1 year ago

0.2.16

1 year ago

0.2.15

1 year ago

0.2.14

1 year ago

0.2.13

1 year ago

0.2.12

1 year ago

0.2.11

1 year ago

0.2.10

1 year ago

0.2.9

1 year ago

0.2.7

1 year ago

0.2.8

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.2.6

1 year ago

0.1.100

1 year ago

0.2.3

1 year ago

0.2.2

1 year ago

0.2.5

1 year ago

0.2.4

1 year ago

0.1.97

1 year ago

0.1.98

1 year ago

0.1.99

1 year ago

0.1.96

1 year ago

0.1.95

1 year ago

0.1.91

1 year ago

0.1.92

1 year ago

0.1.93

1 year ago

0.1.94

1 year ago

0.1.90

1 year ago

0.1.87

1 year ago

0.1.88

1 year ago

0.1.89

1 year ago

0.1.86

1 year ago

0.1.85

2 years ago

0.1.84

2 years ago

0.1.83

2 years ago

0.1.82

2 years ago

0.1.81

2 years ago

0.1.80

2 years ago

0.1.79

2 years ago

0.1.78

2 years ago

0.1.77

2 years ago

0.1.76

2 years ago

0.1.75

2 years ago

0.1.74

2 years ago

0.1.73

2 years ago

0.1.72

2 years ago

0.1.71

2 years ago

0.1.70

2 years ago

0.1.69

2 years ago

0.1.68

2 years ago

0.1.67

2 years ago

0.1.66

2 years ago

0.1.65

2 years ago

0.1.64

2 years ago

0.1.63

2 years ago

0.1.62

2 years ago

0.1.61

2 years ago

0.1.60

2 years ago

0.1.59

2 years ago

0.1.58

2 years ago

0.1.57

2 years ago

0.1.56

2 years ago

0.1.55

2 years ago

0.1.54

2 years ago

0.1.53

2 years ago

0.1.52

2 years ago

0.1.51

2 years ago

0.1.50

2 years ago

0.1.36

2 years ago

0.1.35

2 years ago

0.1.34

2 years ago

0.1.33

2 years ago

0.1.32

2 years ago

0.1.31

2 years ago

0.1.30

2 years ago

0.1.29

2 years ago

0.1.28

2 years ago

0.1.27

2 years ago

0.1.26

2 years ago

0.1.25

2 years ago

0.1.24

2 years ago

0.1.23

2 years ago

0.1.22

2 years ago

0.1.21

2 years ago

0.1.20

2 years ago

0.1.19

2 years ago

0.1.18

2 years ago

0.1.17

2 years ago

0.1.16

2 years ago

0.1.15

2 years ago

0.1.14

2 years ago

0.1.12

2 years ago

0.1.11

2 years ago

0.1.10

2 years ago

0.1.9

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago