Skip to content

Commit

Permalink
bitmap
Browse files Browse the repository at this point in the history
  • Loading branch information
myliang committed Sep 7, 2018
1 parent edb1b76 commit 44a4591
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/algorithm/bitmap.js
@@ -0,0 +1,11 @@
/* eslint no-bitwise: "off" */
/*
v: int value
digit: bit len of v
flag: true or false
*/
const bitmap = (v, digit, flag) => {
const b = 1 << digit;
return flag ? (v | b) : (v ^ b);
};
export default bitmap;
46 changes: 46 additions & 0 deletions src/data/cell.js
@@ -1,4 +1,49 @@
import alphabet from './alphabet';
// import bitmap from '../algorithm/bitmap';

/*
cell:
text: string
merge: [rowLen, colLen]
formula: string,
format: '',
style:
color: string
align: string
valign: string
wrapText: boolean
rotation: between -90 and 90 degrees
border: 1px solid #fff
borderLeft: 1px solid #fff
borderTop:
borderBottom:
borderRight:
font:
name: string
size: int
color: string
bitmap: [bold, italic, underline, strikeout]
*/

const defaultCell = {
format: 'normal',
merge: [1, 1],
text: '',
style: {
color: '#ffffff',
align: 'left',
valign: 'middle',
wrapText: false,
font: {
name: 'Arial',
size: 14,
color: '#666666',
bitmap: 0,
},
},
};

// const cellStyleFontBold = (cell, flag) => {};

// B10 => x,y
const expr2xy = (src) => {
Expand Down Expand Up @@ -158,6 +203,7 @@ const cellRender = (src, formulaMap, getCellText) => {

export default {
render: cellRender,
default: defaultCell,
};
export {
infixExprToSuffixExpr,
Expand Down

0 comments on commit 44a4591

Please sign in to comment.