tSNE_test = render({
data: {values: dataframe},
transform: [
{
filter: "datum.formula == typeSelector || typeSelector == 'all'"
}
],
params: [
{ name: 'mouseOver', select: { type: 'point', on: 'mouseover' } },
{
name: 'typeSelector',
value: 'all',
bind: {
input: 'select',
options: all_types,
name: 'Formula: '
}
},
{ name: 'sel', select: { type: 'interval' }, bind: 'scales' }
],
mark: {type: 'point'},
encoding:{
x: { field: "t-SNE_0", type: 'Q', axis: {title: null} },
y: { field: "t-SNE_1", type: 'Q', axis: {title: null} },
color: {
condition: {
test: "datum.formula == typeSelector || typeSelector == 'all'",
field: 'Cv_cal_per_mol_per_K',
type: 'Q',
scale: {scheme: "redblue"},
title: 'Heat Capacity (cal/(mol·K))'
}
},
opacity: {
condition: { param: 'mouseOver', value: 0.8 },
value: 0.1
},
tooltip: [
{field: 'formula', type: 'N', title: "Chemical Formula"},
{field: 'A_GHz', type: 'Q', title: 'Rotational constant A (GHz)'},
{field: 'B_GHz', type: 'Q', title: 'Rotational constant B (GHz)'},
{field: 'C_GHz', type: 'Q', title: 'Rotational constant C (GHz)'},
{field: 'mu_Debye', type: 'Q', title: 'Dipole moment (Debye)'},
{field: 'alpha_Bohr_pow_3', type: 'Q', title: 'Isotropic polarizability (Bohr^3)'},
{field: 'homo_Hartree', type: 'Q', title: 'Energy of Highest occupied molecular orbital (HOMO) (Hartree)'},
{field: 'lumo_Hartree', type: 'Q', title: 'Energy of Lowest occupied molecular orbital (LUMO) (Hartree)'},
{field: 'gap_Hartree', type: 'Q', title: 'Gap, difference between LUMO and HOMO (Hartree)'},
{field: 'Cv_cal_per_mol_per_K', type: 'Q', title: 'Heat capacity at 298.15 K (cal/(mol·K))'}
]
},
title: "t-SNE (perplexity=30.0)"
})