Skip to content

Commit

Permalink
Visibility is scaffolding - https://twitter.com/swardley/status/15237…
Browse files Browse the repository at this point in the history
  • Loading branch information
damonsk committed Dec 11, 2023
1 parent 190d728 commit ac7ca38
Show file tree
Hide file tree
Showing 10 changed files with 588 additions and 971 deletions.
2 changes: 1 addition & 1 deletion public/mode-owm.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ define('ace/mode/owm_highlight_rules', function(require, exports) {
{
token: ['keyword', 'variable.parameter.function.asp'],
regex:
'(y-axis|evolution|note|anchor|annotations|annotation|component|ecosystem|market|submap|title|style|outsource|build|product|buy|pipeline)(\\s*[-+\'";a-zA-Z0-9\\s*]+)',
'(evolution|note|anchor|annotations|annotation|component|ecosystem|market|submap|title|style|outsource|build|product|buy|pipeline)(\\s*[-+\'";a-zA-Z0-9\\s*]+)',
},
{
token: [
Expand Down
9 changes: 0 additions & 9 deletions src/__tests__/GivenConverter.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,15 +243,6 @@ describe('Convert test suite', function() {
}
);

test('y-axis varible present and extracted', function() {
let actual = 'y-axis Some label->Min label->Max label';
let result = new Converter().parse(actual);

expect(result.presentation.yAxis.label).toEqual('Some label');
expect(result.presentation.yAxis.max).toEqual('Max label');
expect(result.presentation.yAxis.min).toEqual('Min label');
});

test('notes are extracted and made available to the map', function() {
let actual = 'note some text [0.9, 0.1]';
let result = new Converter().parse(actual);
Expand Down
3 changes: 0 additions & 3 deletions src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ function App() {
Defaults.EvolutionStages
);
const [mapStyle, setMapStyle] = useState('plain');
const [mapYAxis, setMapYAxis] = useState({});
const [mapStyleDefs, setMapStyleDefs] = useState(MapStyles.Plain);
const [saveOutstanding, setSaveOutstanding] = useState(false);
const [toggleToolbar, setToggleToolbar] = useState(true);
Expand Down Expand Up @@ -214,7 +213,6 @@ function App() {
setMapMethods(r.methods);
setMapAttitudes(r.attitudes);
setMapStyle(r.presentation.style);
setMapYAxis(r.presentation.yAxis);
setMapAnnotationsPresentation(r.presentation.annotations);
setMapEvolutionStates({
genesis: { l1: r.evolution[0].line1, l2: r.evolution[0].line2 },
Expand Down Expand Up @@ -353,7 +351,6 @@ function App() {
mapAnnotationsPresentation={mapAnnotationsPresentation}
mapMethods={mapMethods}
mapStyleDefs={mapStyleDefs}
mapYAxis={mapYAxis}
mapDimensions={mapDimensions}
mapEvolutionStates={mapEvolutionStates}
mapRef={mapRef}
Expand Down
1 change: 0 additions & 1 deletion src/components/map/MapCanvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ function MapCanvas(props) {
mapStyleClass={props.mapStyleDefs.className}
/>
<MapGrid
mapYAxis={props.mapYAxis}
mapDimensions={props.mapDimensions}
mapStyleDefs={props.mapStyleDefs}
evolutionOffsets={props.evolutionOffsets}
Expand Down
15 changes: 5 additions & 10 deletions src/components/map/foundation/MapGrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function MapGrid(props) {
y2="0"
stroke={props.mapStyleDefs.stroke}
strokeWidth={props.mapStyleDefs.strokeWidth}
markerEnd="url(#graphArrow)"
strokeDasharray={props.mapStyleDefs.strokeDasharray}
/>
<line
x1="-2em"
Expand All @@ -41,19 +41,14 @@ function MapGrid(props) {
stroke={props.mapStyleDefs.evolutionSeparationStroke}
strokeDasharray={props.mapStyleDefs.strokeDasharray}
/>
<text x="0" y="-0.4em" textAnchor="start">
{props.mapYAxis.min}
</text>
<text
x={props.mapDimensions.height / 2}
fill={props.mapStyleDefs.mapGridTextColor}
x={props.mapDimensions.height - 2}
y="-0.4em"
textAnchor="middle"
textAnchor="end"
fontWeight="bold"
>
{props.mapYAxis.label}
</text>
<text x={props.mapDimensions.height - 20} y="-0.4em" textAnchor="end">
{props.mapYAxis.max}
Value Chain
</text>
</g>
);
Expand Down
1 change: 0 additions & 1 deletion src/constants/editorPrefixes.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,4 @@ export const EditorPrefixes = [
'pipeline',
'title',
'evolution',
'y-axis Label->Min->Max',
];
8 changes: 0 additions & 8 deletions src/constants/usages.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,6 @@ const usages = [
'evolution 🧪 Genesis -> ⚒️ Custom -> 🛒 Product -> ⛽ Commodity',
],
},
{
title: 'Y-Axis Labels',
summary: 'Change the text of the y-axis labels',
examples: [
'y-axis Label->Min->Max',
'y-axis Value Chain->Invisible->Visible',
],
},
{
title: 'Add notes',
summary: 'Add text to any part of the map',
Expand Down
1 change: 0 additions & 1 deletion src/conversion/LinksExtractionStrategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export default class LinksExtractionStrategy {
'title',
'annotation',
'annotations',
'y-axis',
'pipeline',
'note',
'pioneers',
Expand Down
12 changes: 0 additions & 12 deletions src/conversion/PresentationExtractionStrategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export default class PresentationExtractionStrategy {
let presentationObject = {
style: 'plain',
annotations: { visibility: 0.9, maturity: 0.1 },
yAxis: { label: 'Value Chain', max: 'Visible', min: 'Invisible' },
};
let lines = this.data.split('\n');
for (let i = 0; i < lines.length; i++) {
Expand All @@ -27,17 +26,6 @@ export default class PresentationExtractionStrategy {
}
);
}
if (element.trim().indexOf('y-axis ') === 0) {
let yAxis = element
.trim()
.split('y-axis ')[1]
.split('->');
if (yAxis.length === 3) {
presentationObject.yAxis.label = yAxis[0].trim();
presentationObject.yAxis.min = yAxis[1].trim();
presentationObject.yAxis.max = yAxis[2].trim();
}
}
}
return { presentation: presentationObject };
}
Expand Down
Loading

0 comments on commit ac7ca38

Please sign in to comment.