In CSS:
.protobi .element .bar.fg {
background-color: #688c40
}
In Javascript:
var styleSheet = _.find(document.styleSheets, {"href": "http://localhost:3000/protobi/style/protobi.css"})
var xlsx = require('xlsx'); | |
var wb = { | |
"Sheets": { | |
"Sheet1": { | |
"!ref": "A1:C7", | |
"A1": { | |
"t": "s", | |
"v": "This is a merged cell", | |
"r": "<t>This is a merged cell</t>", |
var AdmZip = require('adm-zip'); | |
var zip = new AdmZip(__dirname + '/../tinker/format.xlsx'); | |
var themeXml = zip.readAsText("xl/theme/theme1.xml"); | |
var stylesXml = zip.readAsText("xl/styles.xml"); |
{ | |
"mode": "html" | |
} |
"use strict"; | |
var JSZip = require('jszip'); | |
var fs = require("fs"); | |
var FILE1 = process.argv[2]; | |
var FILE2 = process.argv[3]; | |
var zip1 = new JSZip(fs.readFileSync(FILE1)); | |
var zip2 = new JSZip(fs.readFileSync(FILE2)); | |
Object.keys(zip1.files).forEach(function (key) { |
var JSZip = require('jszip'); | |
var fs = require('fs'); | |
var cheerio = require('cheerio'); | |
fs.readdir(DIRECTORY, function (err, files) { | |
files.filter(function (file) {return file.substr(-5).toLowerCase() == ".docx";}).forEach(function (file) { | |
fs.readFile(DIRECTORY + file, function (err, content) { | |
var zip = new JSZip(); | |
zip.load(content); | |
var xml = zip.file('word/document.xml').asText(); |
//http://bgrins.github.io/devtools-snippets/#console-save | |
(function(console){ | |
console.save = function(data, filename){ | |
if(!data) return console.error('Console.save: No data'); | |
if(!filename) filename = 'console.json' | |
if(typeof data === "object") data = JSON.stringify(data, undefined, 4) | |
var blob = new Blob([data], {type: 'text/json'}), | |
e = document.createEvent('MouseEvents'), | |
a = document.createElement('a') |
In CSS: | |
```css | |
.protobi .element .bar.fg { | |
background-color: #688c40 | |
} | |
``` | |
In Javascript: | |
```js | |
var styleSheet = _.find(document.styleSheets, {"href": "http://localhost:3000/protobi/style/protobi.css"}) |
In CSS:
.protobi .element .bar.fg {
background-color: #688c40
}
In Javascript:
var styleSheet = _.find(document.styleSheets, {"href": "http://localhost:3000/protobi/style/protobi.css"})
The function below calculates a single respondent-level weight variable such that when applied as a weight, the marginal distribution of multiple elements yields the desired proportions. This can be useful to ensure that the results of a survey sample reflect the population distribution.
Add this function within a Protobi data process:
/**
* Calculate a single respondent-level weight such that when weighting is applied
* multiple variables yield the desired marginal distribution
Memoized functions to quckly convert z-value and t-values to tables
// memoized table of p values for t values, for df < 30 and t values between 0.1 and 5
// the first index is the number of drgr
var _ttable = [null,{"-2.3":0.532,"-1.6":0.563,"-1.2":0.593,"-0.9":0.621,"-0.7":0.648,"-0.5":0.672,"-0.4":0.694,"-0.2":0.715,"-0.1":0.733,"-0.0":0.75,"0.1":0.765,"0.2":0.779,"0.3":0.803,"0.4":0.813,"0.5":0.831,"0.6":0.846,"0.7":0.859,"0.8":0.869,"0.9":0.879,"1.0":0.891,"1.1":0.901,"1.2":0.909,"1.3":0.918,"1.4":0.926,"1.5":0.933,"1.6":0.937},{"-2.3":0.535,"-1.6":0.57,"-1.2":0.604,"-0.9":0.636,"-0.7":0.667,"-0.5":0.695,"-0.4":0.722,"-0.2":0.746,"-0.1":0.768,"-0.0":0.789,"0.1":0.807,"0.2":0.823,"0.3":0.852,"0.4":0.864,"0.5":0.884,"0.6":0.901,"0.7":0.915,"0.8":0.926,"0.9":0.935,"1.0":0.946,"1.1":0.955,"1.2":0.962,"1.3":0.969,"1.4":0.974,"1.5":0.979,"1.6":0.981},{"-2.3":0.537,"-1.6":0.573,"-1.2":0.608,"-0.9":0.642,"-0.7":0.674,"-0.5":0.705,"-0.4":0.733,"-0.2":0.759,"-0.1":0.783,"