0.2.25 • Published 12 months ago

do_graphs v0.2.25

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

12 months ago

0.2.24

12 months ago

0.2.23

12 months ago

0.2.22

12 months ago

0.2.21

12 months ago

0.2.20

12 months ago

0.2.19

12 months 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

1 year ago

0.1.84

1 year ago

0.1.83

1 year ago

0.1.82

1 year ago

0.1.81

1 year ago

0.1.80

1 year ago

0.1.79

1 year ago

0.1.78

1 year ago

0.1.77

1 year ago

0.1.76

1 year ago

0.1.75

1 year ago

0.1.74

1 year ago

0.1.73

1 year ago

0.1.72

1 year ago

0.1.71

1 year ago

0.1.70

1 year ago

0.1.69

1 year ago

0.1.68

1 year ago

0.1.67

1 year ago

0.1.66

1 year ago

0.1.65

1 year ago

0.1.64

1 year ago

0.1.63

1 year ago

0.1.62

1 year ago

0.1.61

1 year ago

0.1.60

1 year ago

0.1.59

1 year ago

0.1.58

1 year ago

0.1.57

1 year ago

0.1.56

1 year ago

0.1.55

1 year ago

0.1.54

1 year ago

0.1.53

1 year ago

0.1.52

1 year ago

0.1.51

1 year ago

0.1.50

1 year ago

0.1.36

1 year ago

0.1.35

1 year ago

0.1.34

1 year ago

0.1.33

1 year ago

0.1.32

1 year ago

0.1.31

1 year ago

0.1.30

1 year ago

0.1.29

1 year ago

0.1.28

1 year ago

0.1.27

1 year ago

0.1.26

1 year ago

0.1.25

1 year ago

0.1.24

1 year ago

0.1.23

1 year ago

0.1.22

1 year ago

0.1.21

1 year ago

0.1.20

1 year ago

0.1.19

1 year ago

0.1.18

1 year ago

0.1.17

1 year ago

0.1.16

1 year ago

0.1.15

1 year ago

0.1.14

1 year ago

0.1.12

1 year ago

0.1.11

1 year ago

0.1.10

1 year ago

0.1.9

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago