Viewing properties

The function view.properties allows you to view information about the properties in a dataset

For example:

List all properties

view.properties returns a collection that can be used in the same way as node.something

view.properties

image

Number of properties in dataset

Adding .count will return the number of properties in the dataset

view.properties.count

image

This includes OrgVue-generated properties

Number of data properties

To exclude the generated properties and count data properties only, use

view.properties.filter(is.match({ isGenerated: false })).count

image

Number of evaluated properties

Evaluated properties are those containing expressions and these can be returned using

view.properties.filter(p=>p.isEvaluated).count

image

Count of number properties

view.properties.filter(p=>p.type == 'number').count

image

number in this expression may be replace with other property types text, date, boolean to return the relative count

Viewing details of dataset

To extract details of all properties in a dataset including:

  • Property Name
  • Property Key
  • Property Type
  • Default Value
  • Any property tags
  • Indicators for generated and evaluated properties
  • Expressions

Use:

view.properties.map(p => ({
    name: p.name,
    key: p.key,
    type: p.type,
    defaultValue: p.expression,
    tags: p.tags,
    isGenerated: p.isGenerated,
    isEvaluated: p.isEvaluated,
    expression: p.expression
}))

Which will return the results in a simple table format that can be copied from the Gizmo results window and pasted into spreadsheet

image

Viewing property buckets of dataset

To extract the details of all non generated properties and the buckets within them in a simple table

Use:ew

const propsWithLookup = view.properties.filter(p => p.isGenerated == false).take(50)
const propsObject = propsWithLookup.map(p => [p.name, " "]).objectFromEntries()
const propsBuckets = propsWithLookup.map(p => ({ prop: p.name, buckets: p.buckets.name, bucketLength: p.buckets.length }))
const maxBucketLength = propsBuckets.bucketLength.max
const propsBucketsTable = Array.from({ length: propsBuckets.bucketLength.max }, () => ({ ...propsObject }))
propsBuckets.forEach(p => {
    let i = 0
    p.buckets.forEach(b => {
        propsBucketsTable[i++][p.prop] = b
    })
})
array(propsBucketsTable)

Which will return the results in a simple table format that can be copied from the Gizmo results window and pasted into spreadsheet

image

results matching ""

    No results matching ""

    results matching ""

      No results matching ""