MCPcopy Create free account
hub / github.com/breck7/scroll / getOneHot

Method getOneHot

external/.scrollLibs.js:15691–15702  ·  view source on GitHub ↗
(column)

Source from the content-addressed store, hash-verified

15689 return this._getUnionNames()
15690 }
15691 getOneHot(column) {
15692 const clone = this.clone()
15693 const cols = Array.from(new Set(clone.getColumn(column)))
15694 clone.forEach(particle => {
15695 const val = particle.get(column)
15696 particle.delete(column)
15697 cols.forEach(col => {
15698 particle.set(column + "_" + col, val === col ? "1" : "0")
15699 })
15700 })
15701 return clone
15702 }
15703 // todo: return array? getPathArray?
15704 _getCuePath(relativeTo) {
15705 if (this.isRoot(relativeTo)) return ""

Callers

nothing calls this directly

Calls 7

cloneMethod · 0.95
getColumnMethod · 0.80
forEachMethod · 0.80
fromMethod · 0.45
getMethod · 0.45
deleteMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected