This is a custom sprinkle for the UserFrosting framework to show visual charts of account information. (A "sprinkle" is a UserFrosting plugin/module.)
This sprinkle adds bar and pie charts into the standard UserFrosting administration screens. The charts show up automatically when you click on any of the following administration options from the left navigation area:
- Users
- Activities
- Roles
- Permissions
- Groups
There are several chart options displayed near the top of each page next to the label "Chart Options" as shown in the partial screenshot below. (The "none" option has been selected.)
This sprinkle does not modify your database and can simply be installed by adding a dependency declaration into your app/sprinkles.json in the standard UserFrosting recommended manner.
The example app/sprinkles.json file shown here adds this sprinkle into the require section and then declares it at the bottom of the base section too.
{
"require": {
"frankfont/uf-sprinkle-account-graphs" : ">=0.0"
},
"base": [
"core",
"account",
"admin",
"uf-sprinkle-account-graphs"
]
}
The sprinkle is downloaded and installed when you run the following command from your UserFrosting docroot:
composer update
After the update, you probably also need to run this UserFrosting command so that the assets get deployed ...
php bakery build-assets
The default.php declares the default chart shown for each page. You can override these values with a app/.env file or by overriding the default.php entries in code. The values for the app/.env are as follows:
SPRINKLE.ACCOUNT_GRAPHS.USERS.DEFAULT.TYPENAME=bar SPRINKLE.ACCOUNT_GRAPHS.ACTIVITIES.DEFAULT.TYPENAME=bar SPRINKLE.ACCOUNT_GRAPHS.ROLES.DEFAULT.TYPENAME=bar SPRINKLE.ACCOUNT_GRAPHS.PERMISSIONS.DEFAULT.TYPENAME=bar SPRINKLE.ACCOUNT_GRAPHS.GROUPS.DEFAULT.TYPENAME=bar
SPRINKLE.ACCOUNT_GRAPHS.COLORS.DEFAULT.FILL.LIGHT_ALPHA=.2 SPRINKLE.ACCOUNT_GRAPHS.COLORS.DEFAULT.FILL.MEDIUM_ALPHA=.5
In the example above, if you replace bar with none, then by default no chart is displayed.
This sprinkle also makes available full size charts at the following URLs of your site.
- /graph/group/memberships
- /graph/role/memberships
- /graph/permission/memberships
- /graph/activity/view
- /graph/users/view