add row index to bit matrix (#115)

* add row index to bit matrix

* reduce padding a bit

* fix test

Co-authored-by: Joost Wooning <jwooning@gmail.com>
main
Adeeb Shihadeh 2022-02-22 02:48:57 -08:00 committed by GitHub
parent e73f83bba1
commit 6d07fa48e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -19,7 +19,7 @@ configurable in the legend.
const Styles = StyleSheet.create({
bit: {
margin: 0,
padding: 12,
padding: 9,
userSelect: 'none',
cursor: 'pointer',
textAlign: 'center',
@ -28,6 +28,9 @@ const Styles = StyleSheet.create({
bitSelectedStyle: {
backgroundColor: 'rgba(0,119,158,0.5)'
},
byteIndex: {
backgroundColor: '#ededed'
},
bitSignificance: {
fontSize: 12,
display: 'block',
@ -439,6 +442,9 @@ export default class AddSignals extends Component {
for (let i = 0; i < rowCount; i++) {
const rowBits = [];
rowBits.push(<td key={`rowIndex${i}`} className={css(Styles.bit, Styles.byteIndex)}>{i.toString()}</td>);
for (let j = 7; j >= 0; j--) {
const bitIdx = i * 8 + j;
const signal = this.signalForBit(bitIdx);
@ -472,7 +478,7 @@ export default class AddSignals extends Component {
);
}
rowBits.push(<td key="hex-repr">{this.byteValueHex(i)}</td>);
rowBits.push(<td key="hex-repr" className={css(Styles.bit)}><b>{this.byteValueHex(i)}</b></td>);
rows.push(<tr key={i.toString()}>{rowBits}</tr>);
}