1.14.1 • Published 3 years ago

d2l-insights-tiles v1.14.1

Weekly downloads
122
License
-
Repository
github
Last release
3 years ago

insights-tiles

NPM version Build status

Overview

This library contains the React components for the tiles. Currently being used in insights-class-insights.

Version Handling

This repository is part of Orcavenger's CI pipeline. On merge to master the minor version will increment automatically, and tagged for release. If you want to increment the major version write increment major in the box provided when merging. If you want to increment the patch version write increment patch in the box provided when merging. There is no need for a developer to manually update this module's version.

Usage

Inactive Aggregation Tile Engagement

Use this tile to display the number of student have have not accessed the course in the past 7 days in an aggregation tile. You can find an example usage at insights-class-insights.

ArgumentRequiredTypeDescription
dataYes{students: [{lastCourseAccess: moment(x)}]}Used to compute the value and description of the resulting aggregation tile.
filterdDataYes{students: [{lastCourseAccess: moment(x)}]}Used to compute the value and description of the resulting aggregation tile.
filtersYesDictionaryA dictionary of active filters
contextYes{timezone: 'some/Timezone'}Will be used to determine the timezone
setFilterYesfunc(key, filters)Callback that takes a key and array of filters.
removeFilterYesfunc(filtersName)Callback that takes the name of a filter and removes it.
<NumberOfInactiveStudentsTile
      data={classroomData}
      filteredData={classroomData}
      filters={[f1, f2, ... fn]}
      context={{timezone: 'someTimezone'}} />
      setFilter={function(name, filter) {//do something}}
      removeFilter={function(filterName) {//do something}}

Computing Aggregation Tile

Use this tile to configure an aggregation tile that will display some value and description that is computed by the dataset it is given. You are responsible for ensuring the functions for computing the value, description.

ArgumentRequiredTypeDescription
clickNofunc()Determine action taken when tile is clicked.
computeDescriptionYesfunc(computedValue, data, computedMetaValue, metaData)Function used to compute the description.
computeDisabilityYesfunc(computedValue, data, computedMetaValue, metaData)Function used to determine if the tile should be disabled.
computeMetaValueNofunc(metaData)Function used to compute extra information
computeValueYesfunc(data, computedMetaValue, metaData)Function used to compute the aggregated value
dataYesanyUsed to compute the value and description of the resulting aggregation tile.
metaDataNoanyExtra information that may be required for computeValue, computeDisability or computeDescription.
 <ComputingAggregationTile
    click={onclickFunction()}
    computeDescription={computingDescriptionFunction(computedValue, data, computedMetaValue, metaData)}
    computeDisability={this.computingDisabilityFunction(computedValue, data, computedMetaValue, metaData)}
    computeMetaValue={computingMetaValueFunction(metaData)}
    computeValue={computingValueFunction(data, computedMetaValue, metaData)}
    data={yourDataset}
    metaData={yourDataset} />

Aggregation Tile

Use this tile if you already know the final value for your aggregation and the associated description.

ArgumentRequiredTypeDescription
dataYes{value: aggregatedValue, description: description}Determines what to display on the tile.
disabledNo (Default: false)booleanWhen the tile is disabled it is unclickable and greyed out.
clickNofunc()Determine action taken when tile is clicked.
selectedNo (Default: false)booleanThe state of the tile, passed down from the parent (usually via flux or implied by whether filter is applied or not)
freezeOnZeroNo. (Default: false)booleanclearFilter('search-bar')Determines if the tile should freeze its value on the screen if the computed value is zero.
 <AggregationTile
     data={{value: expectedValue, description: expectedDescription}}
     disabled={true/false}
     click={expectedClick}
     selected={true/false}
     freezeOnZero={true/false} />

Grade Distribution Tile

ArgumentRequiredTypeDescription
dataYesObjectThe unfiltered set of student data
filteredDataYesObjectThe filtered set of student data
langTermsYesObjectLang terms for the component
setFilterYesfunc()Callback from parent to run when filter from this tile should be applied
removeFilterYesfunc()Callback from parent to run when filter from this tile should be removed
filtersYesObjectThe set of currently active filters
<GradeDistributionTile
      data={students:[array of student data]}
      filteredData={students:[array of filtered student data]}
      langTerms={Object containing lang terms}
      setFilter={setFilterCallback}
      removeFilter={removeFilterCallback}
      filters={KVP object of current filters}
      />

##Example Student Object:

{
    "firstName": "string", //User's first name
    "lastName": "string", //User's last name
    "studentId": "string", //User's username (Login name)
    "studentNumber": "string", //User's Org Defined ID
    "userId": "int", //User's D2LID (duplicate)
    "key": "int", //User's D2LID
    "currentGrade": "int", //Aggregated value that represents the users current grade
    "lastCourseAccess": "Moment.js object with LE timezone",
    "predictedGrade": "int", //Aggregated value that predicts the user's final grade (via S3)
    "threadsStarted": "int", //Aggregated count of threads the user has started
    "postsRepliedTo": "int", //Aggregated count of posts the user has replied to
    "fullName": "string", //full name of the student
    "discussions": "int" //value that represents the sort
}
1.14.1

3 years ago

1.7.1

3 years ago

1.14.0

8 years ago

1.13.0

8 years ago

1.12.0

8 years ago

1.7.0

8 years ago

1.6.0

8 years ago

1.5.0

8 years ago

1.4.0

8 years ago

1.3.0

8 years ago

1.2.0

8 years ago

1.1.0

8 years ago

0.30.0

8 years ago

0.29.0

8 years ago

0.28.0

8 years ago

0.27.0

8 years ago

0.26.0

8 years ago

0.25.0

8 years ago

0.22.0

8 years ago

0.21.0

8 years ago

0.20.0

8 years ago

0.19.0

8 years ago

0.18.0

8 years ago

0.17.0

8 years ago

0.16.0

8 years ago

0.15.0

8 years ago

0.14.0

8 years ago

0.13.0

8 years ago

0.12.0

8 years ago

0.11.0

8 years ago

0.10.0

8 years ago

0.9.0

8 years ago

0.8.0

8 years ago

0.7.0

8 years ago

0.6.0

8 years ago

0.5.0

8 years ago

0.4.0

8 years ago

0.3.0

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago