Introduction
ProvenanceWidgets is a Javascript library of UI control elements that track and dynamically overlay a user's analytic provenance in situ and out of the box. These enhanced widgets track how often (frequently) and how recently a user has interacted with them and display this information in a visual overlay. The in situ overlays not only save screen space but also minimize the amount of time and effort needed to access the same information from elsewhere in the UI.
Getting Started
What you'll need
- Node.js version 20.0 or above and npm version 10.0 or above:
- When installing Node.js, you are recommended to check all checkboxes related to dependencies.
Quick Start
For getting started quickly, clone one of our starter code repositories:
- Angular
- Web Components
git clone https://github.com/ProvenanceWidgets/provenance-widgets-starter
git clone https://github.com/ProvenanceWidgets/provenance-widgets-vanilla-starter
Then, navigate to the project directory and install the dependencies:
- Angular
- Web Components
cd provenance-widgets-starter
cd provenance-widgets-vanilla-starter
Finally, install the dependencies and start the development server:
npm install
npm run start
Manual Setup
Installation
npm install provenance-widgets
Configuration
- Angular
- Web components
Add the following to your projects's angular.json file to apply PrimeNG's styles:
{
"projects": {
"<your-project>": {
"architect": {
"build": {
"options": {
// Add the following:
// Used by Provenance Widgets for deep object comparisons
"allowedCommonJsDependencies": [
// Your allowedCommonJsDependencies here
"lodash.isequal"
],
// Provenance Widgets builds up on PrimeNG's components. Hence, it relies on PrimeNG, PrimeFlex and PrimeIcons for styling.
"styles": [
// Your styles here
"node_modules/primeicons/primeicons.css",
"node_modules/primeng/resources/themes/lara-light-blue/theme.css",
"node_modules/primeng/resources/primeng.min.css",
"node_modules/primeflex/primeflex.css"
]
}
}
}
}
}
}
Then, import the ProvenanceWidgetsModule in your app.module.ts file:
import { ProvenanceWidgetsModule } from 'provenance-widgets';
@NgModule({
declarations: [
// Your declarations here
],
imports: [
// Your imports here
ProvenanceWidgetsModule
],
providers: [
// Your providers here
],
bootstrap: [AppComponent]
})
export class AppModule { }
Add the following to your project's index.html file to import Provenance Widgets' web components and styles:
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Your head tags here -->
<script type="text/javascript" src="/node_modules/provenance-widgets/web-components/index.js"></script>
<link rel="stylesheet" href="/node_modules/provenance-widgets/web-components/styles.css" />
</head>
<body>
<!-- Your body here -->
</body>
</html>