|
| 1 | +# yFiles React Process Mining Component |
| 2 | + |
| 3 | +[](https://www.npmjs.org/package/@yworks/react-yfiles-process-mining) |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | +Process mining is a technique that involves extracting insights from event logs to understand and improve business |
| 8 | +processes. By analyzing event data, process mining techniques reveal the actual flow of processes, identify bottlenecks, |
| 9 | +deviations, and opportunities for improvement. |
| 10 | + |
| 11 | +The *yFiles React Process Mining Component* uses the [yFiles](https://www.yworks.com/yfiles-overview) library in order |
| 12 | +to extract interactive process mining diagrams from event-logs and load them into your React applications. This enhances |
| 13 | +the user experience and facilitates an intuitive exploration of complex processes. |
| 14 | + |
| 15 | +## Getting Started |
| 16 | + |
| 17 | +### Prerequisites |
| 18 | + |
| 19 | +To use the Process Mining component, [yFiles for HTML](https://www.yworks.com/products/yfiles-for-html) is required. |
| 20 | +You can evaluate yFiles for 60 days free of charge on [my.yworks.com](https://my.yworks.com/signup?product=YFILES_HTML_EVAL). |
| 21 | +See [Licensing](https://docs.yworks.com/react-yfiles-process-mining/introduction/licensing) for more information on this topic. |
| 22 | + |
| 23 | +You can learn how to work with the yFiles npm module in our [Developer’s Guide](https://docs.yworks.com/yfileshtml/#/dguide/yfiles_npm_module). A convenient way of getting access to yFiles is to use the [yFiles Dev Suite](https://www.npmjs.com/package/yfiles-dev-suite). |
| 24 | + |
| 25 | + |
| 26 | +### Project Setup |
| 27 | + |
| 28 | +1. **Installation** |
| 29 | + |
| 30 | + In addition to yFiles, the Process Mining component requires React to be installed in your project. |
| 31 | + If you want to start your project from scratch, we recommend using vite: |
| 32 | + ``` |
| 33 | + npm create vite@latest my-process-mining-app -- --template react-ts |
| 34 | + ``` |
| 35 | + |
| 36 | + Add the yFiles dependency: |
| 37 | + ``` |
| 38 | + npm install <yFiles package path>/lib-dev/yfiles-26.0.0+dev.tgz |
| 39 | + ``` |
| 40 | + |
| 41 | + <details> |
| 42 | + |
| 43 | + <summary>Sample <code>package.json</code> dependencies</summary> |
| 44 | + The resulting package.json dependencies should resemble the following: |
| 45 | + |
| 46 | + ```json |
| 47 | + "dependencies": { |
| 48 | + "react": "^18.2.0", |
| 49 | + "react-dom": "^18.2.0", |
| 50 | + "yfiles": "./lib-dev/yfiles-26.0.0.tgz" |
| 51 | + } |
| 52 | + ``` |
| 53 | + </details> |
| 54 | + |
| 55 | + Now, the component itself can be installed: |
| 56 | + ```bash |
| 57 | + npm install @yworks/react-yfiles-process-mining |
| 58 | + ``` |
| 59 | + |
| 60 | +2. **License** |
| 61 | + |
| 62 | + Be sure to invoke the `registerLicense` function before using the Process Mining React component. |
| 63 | + When evaluating yFiles, the license JSON file is found in the `lib/` folder of the yFiles for HTML evaluation package. |
| 64 | + For licensed users, the license data is provided separately. |
| 65 | + |
| 66 | + <details> |
| 67 | + |
| 68 | + <summary>License registration</summary> |
| 69 | + |
| 70 | + Import or paste your license data and register the license, e.g. in `App.tsx`: |
| 71 | + |
| 72 | + ```js |
| 73 | + import yFilesLicense from './license.json' |
| 74 | + |
| 75 | + registerLicense(yFilesLicense) |
| 76 | + ``` |
| 77 | + </details> |
| 78 | + |
| 79 | +3. **Stylesheet** |
| 80 | + |
| 81 | + Make sure to import the CSS stylesheet as well: |
| 82 | + |
| 83 | + ```js |
| 84 | + import '@yworks/react-yfiles-process-mining/dist/index.css' |
| 85 | + ``` |
| 86 | + |
| 87 | +4. **Usage** |
| 88 | + |
| 89 | + You are now all set to utilize the Process Mining component with your data! |
| 90 | + See a basic example `App.tsx` below: |
| 91 | + |
| 92 | + ```tsx |
| 93 | + import { |
| 94 | + ProcessMining, |
| 95 | + registerLicense |
| 96 | + } from '@yworks/react-yfiles-process-mining' |
| 97 | + |
| 98 | + import '@yworks/react-yfiles-process-mining/dist/index.css' |
| 99 | + |
| 100 | + import yFilesLicense from './license.json' |
| 101 | + |
| 102 | + registerLicense(yFilesLicense) |
| 103 | + |
| 104 | + const eventLog = [ |
| 105 | + { caseId: 0, activity: 'Start', timestamp: 8.383561495922297, duration: 0.0006804154279300233 }, |
| 106 | + { caseId: 0, activity: 'Step A', timestamp: 8.928697652413142, duration: 0.10316578562597925 }, |
| 107 | + { caseId: 0, activity: 'Step B', timestamp: 9.576999594529966, duration: 0.041202953341980784 }, |
| 108 | + { caseId: 0, activity: 'End', timestamp: 10.163338704362792, duration: 0.2746326125522593 } |
| 109 | + ] |
| 110 | + |
| 111 | + function App() { |
| 112 | + return <ProcessMining eventLog={eventLog}></ProcessMining> |
| 113 | + } |
| 114 | + |
| 115 | + export default App |
| 116 | + ``` |
| 117 | + |
| 118 | + > **Note:** By default, the Process Mining component adjusts its size to match the size of its |
| 119 | + > parent element. Therefore, it is necessary to set the dimensions of the containing element or apply styling |
| 120 | + > directly to the Process Mining component. This can be achieved by defining a CSS class or |
| 121 | + > applying inline styles. |
| 122 | +
|
| 123 | +## Live Playground |
| 124 | + |
| 125 | +[](https://docs.yworks.com/react-yfiles-process-mining/introduction/welcome) |
| 126 | + |
| 127 | +Try the yFiles React Process Mining component directly in your browser with our [playground](https://docs.yworks.com/react-yfiles-process-mining/introduction/welcome). |
| 128 | + |
| 129 | + |
| 130 | +## Licensing |
| 131 | + |
| 132 | +All owners of a valid software license for [yFiles for HTML](https://www.yworks.com/products/yfiles-for-html) |
| 133 | +are allowed to use these sources as the basis for their own [yFiles for HTML](https://www.yworks.com/products/yfiles-for-html) |
| 134 | +powered applications. |
| 135 | + |
| 136 | +Use of such programs is governed by the rights and conditions as set out in the |
| 137 | +[yFiles for HTML license agreement](https://www.yworks.com/products/yfiles-for-html/sla). |
| 138 | + |
| 139 | +You can evaluate yFiles for 60 days free of charge on [my.yworks.com](https://my.yworks.com/signup?product=YFILES_HTML_EVAL). |
| 140 | + |
| 141 | +For more information, see the `LICENSE` file. |
| 142 | + |
| 143 | + |
| 144 | +## Learn More |
| 145 | + |
| 146 | +Explore the possibilities of visualizing process mining diagrams with the yFiles Process Mining Component. For further |
| 147 | +information about [yFiles for HTML](https://www.yworks.com/yfiles-overview) and our company, please visit [yWorks.com](https://www.yworks.com). |
| 148 | + |
| 149 | +If you are exploring a different use case and require another React component, |
| 150 | +please take a look at the available [React components](https://www.yworks.com/yfiles-react-components) powered by yFiles! |
| 151 | + |
| 152 | +For support or feedback, please reach out to [our support team](https://website.yworks.home/contact) or open an issue on GitHub. Happy diagramming! |
| 153 | + |
0 commit comments