├── .prettierignore ├── client ├── utils │ ├── dataUrlToBlob.js │ ├── ceil.js │ ├── flatMap.js │ ├── round.js │ ├── fixPositionToGrid.js │ ├── tests │ │ ├── range.test.js │ │ ├── ceil.test.js │ │ ├── round.test.js │ │ ├── constrainLocactionToShape.test.js │ │ ├── throttle.test.js │ │ ├── fixPositionToGrid.test.js │ │ ├── relativePosition.test.js │ │ ├── generateElementId.test.js │ │ └── fixDeltaToGrid.test.js │ ├── throttle.js │ ├── range.js │ ├── relativePosition.js │ ├── index.js │ ├── fixDeltaToGrid.js │ ├── diagramBoundingBox.js │ ├── generateElementId.js │ ├── constrainLocationToShape.js │ └── elementsWithLocations.js ├── components │ ├── Checkbox │ │ ├── styles.js │ │ └── index.js │ ├── Slider │ │ ├── slider.css │ │ ├── index.js │ │ └── styles.js │ ├── Select │ │ ├── styles.js │ │ ├── option.js │ │ └── index.js │ ├── Code │ │ ├── index.js │ │ └── styles.js │ ├── Label │ │ ├── styles.js │ │ └── index.js │ ├── RedButton │ │ ├── index.js │ │ └── styles.js │ ├── ToggleButton │ │ ├── styles.js │ │ └── index.js │ ├── Button │ │ ├── index.js │ │ └── styles.js │ ├── Input │ │ ├── styles.js │ │ └── index.js │ ├── Overlay │ │ ├── Header │ │ │ ├── index.js │ │ │ └── styles.js │ │ ├── styles.js │ │ ├── index.js │ │ └── test.js │ ├── Collapsible │ │ ├── styles.js │ │ └── index.js │ ├── ColorPicker │ │ ├── styles.js │ │ ├── index.js │ │ └── test.js │ ├── index.js │ ├── Splittable │ │ └── test.js │ └── Text │ │ └── index.js ├── actions │ ├── info │ │ ├── index.js │ │ ├── creators │ │ │ ├── zoomIn.js │ │ │ ├── zoomOut.js │ │ │ ├── toggleGrid.js │ │ │ ├── toggleAnchors.js │ │ │ ├── toggleHistory.js │ │ │ ├── toggleHotkeys.js │ │ │ ├── setZoom.js │ │ │ ├── panDiagram.js │ │ │ ├── toggleExportModal.js │ │ │ ├── setDiagramTitle.js │ │ │ ├── setGridSize.js │ │ │ ├── togglePatternModal.js │ │ │ ├── index.js │ │ │ └── togglePatternModalInitialVis.js │ │ ├── storage.js │ │ ├── types.js │ │ └── storage.test.js │ ├── elements │ │ ├── index.js │ │ ├── creators │ │ │ ├── clearElements.js │ │ │ ├── clearSelection.js │ │ │ ├── deleteSelection.js │ │ │ ├── splitElement.js │ │ │ ├── addAnchors.js │ │ │ ├── loadDiagram.js │ │ │ ├── loadPattern.js │ │ │ ├── snapSelectedElements.js │ │ │ ├── deleteElements.js │ │ │ ├── placeElement.js │ │ │ ├── setElementAttrs.js │ │ │ ├── moveSelectedElements.js │ │ │ ├── selectElements.js │ │ │ ├── addPropagators.js │ │ │ ├── setAnchorLocations.js │ │ │ ├── alignSelectedAnchors.js │ │ │ ├── mergeElements.js │ │ │ ├── addElements.js │ │ │ ├── saveDiagram.js │ │ │ └── index.js │ │ ├── types.js │ │ └── tests │ │ │ └── propagators.test.js │ └── history │ │ ├── index.js │ │ ├── creators │ │ ├── redo.js │ │ ├── undo.js │ │ ├── goto.js │ │ ├── commit.js │ │ ├── index.js │ │ └── withCommit.js │ │ ├── types.js │ │ └── test.js ├── interface │ ├── Toolbar │ │ ├── utils │ │ │ ├── index.js │ │ │ ├── anchorsInSpec.js │ │ │ └── tests │ │ │ │ └── anchorsInSpec.test.js │ │ ├── ItemPalette │ │ │ ├── images │ │ │ │ ├── em.png │ │ │ │ ├── circle.png │ │ │ │ ├── dashed.png │ │ │ │ ├── gluon.png │ │ │ │ ├── line.png │ │ │ │ ├── text.png │ │ │ │ └── index.js │ │ │ ├── paletteItem.js │ │ │ ├── styles.js │ │ │ └── index.js │ │ ├── SelectionSummary │ │ │ ├── PropagatorSummary │ │ │ │ ├── GluonSummary │ │ │ │ │ ├── styles.js │ │ │ │ │ └── index.js │ │ │ │ ├── styles.js │ │ │ │ ├── FermionSummary │ │ │ │ │ ├── styles.js │ │ │ │ │ └── index.js │ │ │ │ └── ElectroWeakSummary │ │ │ │ │ └── index.js │ │ │ ├── ShapeSummary │ │ │ │ ├── styles.js │ │ │ │ └── index.js │ │ │ ├── ButtonRow │ │ │ │ ├── styles.js │ │ │ │ └── index.js │ │ │ ├── TextSummary │ │ │ │ ├── styles.js │ │ │ │ └── index.js │ │ │ ├── Container │ │ │ │ ├── styles.js │ │ │ │ └── index.js │ │ │ ├── styles.js │ │ │ ├── MultiRow │ │ │ │ ├── styles.js │ │ │ │ └── index.js │ │ │ ├── Header │ │ │ │ ├── styles.js │ │ │ │ └── index.js │ │ │ ├── Label │ │ │ │ ├── styles.js │ │ │ │ └── index.js │ │ │ ├── Row │ │ │ │ ├── index.js │ │ │ │ └── styles.js │ │ │ ├── SliderRow │ │ │ │ ├── styles.js │ │ │ │ └── index.js │ │ │ ├── AnchorSummary │ │ │ │ └── styles.js │ │ │ └── index.js │ │ ├── Footer │ │ │ ├── styles.js │ │ │ └── index.js │ │ ├── styles.js │ │ └── specs.js │ ├── Sidebar │ │ ├── GridSizeControl │ │ │ ├── slider.css │ │ │ ├── styles.js │ │ │ └── index.js │ │ ├── ZoomLevelControl │ │ │ ├── slider.css │ │ │ ├── styles.js │ │ │ └── index.js │ │ ├── HistorySummary │ │ │ ├── styles.js │ │ │ ├── Entry │ │ │ │ ├── index.js │ │ │ │ └── styles.js │ │ │ ├── index.js │ │ │ └── test.js │ │ ├── HotkeySummary │ │ │ ├── styles.js │ │ │ ├── Hotkey │ │ │ │ ├── styles.js │ │ │ │ └── index.js │ │ │ └── index.js │ │ ├── TitleControl │ │ │ ├── styles.js │ │ │ └── index.js │ │ ├── ButtonGrid │ │ │ └── styles.js │ │ ├── styles.js │ │ └── index.js │ ├── PatternModal │ │ ├── patterns │ │ │ ├── blank │ │ │ │ ├── preview.js │ │ │ │ └── index.js │ │ │ ├── index.js │ │ │ └── dy │ │ │ │ └── index.js │ │ ├── styles.js │ │ ├── Choice │ │ │ ├── styles.js │ │ │ └── index.js │ │ └── index.js │ ├── Diagram │ │ ├── Text │ │ │ ├── styles.js │ │ │ └── index.js │ │ ├── Grid │ │ │ ├── styles.js │ │ │ └── index.js │ │ ├── Propagator │ │ │ ├── styles.js │ │ │ ├── Fermion │ │ │ │ ├── styles.js │ │ │ │ ├── index.js │ │ │ │ └── Arrow.js │ │ │ ├── Dashed │ │ │ │ └── index.js │ │ │ ├── Gluon │ │ │ │ ├── index.js │ │ │ │ └── withoutEndcaps.js │ │ │ ├── Label │ │ │ │ ├── relLocForLabel.js │ │ │ │ ├── locationForLabel.js │ │ │ │ └── index.js │ │ │ ├── Align.js │ │ │ ├── index.js │ │ │ └── ElectroWeak │ │ │ │ └── index.js │ │ ├── Anchor │ │ │ ├── styles.js │ │ │ └── index.js │ │ ├── SelectionRectangle │ │ │ ├── styles.js │ │ │ └── index.js │ │ ├── styles.js │ │ ├── Shape │ │ │ ├── Parton │ │ │ │ └── index.js │ │ │ └── index.js │ │ └── Patterns.js │ ├── App │ │ ├── Alert │ │ │ ├── index.js │ │ │ └── styles.js │ │ ├── styles.js │ │ ├── index.js │ │ └── reset.css │ ├── index.js │ ├── ExportModal │ │ ├── styles.js │ │ └── index.js │ └── Title │ │ ├── index.js │ │ ├── styles.js │ │ └── tests │ │ └── title.test.js ├── sagas │ ├── placeElements │ │ ├── placeShapes.js │ │ ├── placeAnchor.js │ │ ├── placeText.js │ │ ├── tests │ │ │ ├── placeAnchor.test.js │ │ │ ├── placeText.test.js │ │ │ └── placeShapes.test.js │ │ └── placePropagator.js │ ├── index.js │ ├── withCommit │ │ ├── index.js │ │ └── test.js │ ├── loadPattern │ │ ├── index.js │ │ └── test.js │ ├── splitElement │ │ ├── test.js │ │ ├── index.js │ │ ├── anchor.js │ │ ├── shape.js │ │ └── propagator.js │ └── loadDiagram │ │ ├── test.js │ │ └── index.js ├── store │ ├── browser.js │ ├── tests │ │ ├── store.test.js │ │ └── browser.test.js │ ├── index.js │ └── diagram │ │ └── elements │ │ ├── selection.js │ │ └── propagators.js ├── colors.js ├── index.js └── index.html ├── server ├── test │ ├── feynman.sty │ └── diagram.tex ├── templates │ ├── error.tex.tmpl │ ├── diagram.tex.tmpl │ ├── string.tex.tmpl │ └── base.tex.tmpl ├── go.mod ├── charts │ ├── service.yaml │ ├── cert.yaml │ └── deployment.yaml ├── Dockerfile └── main.go ├── config ├── __mocks__ │ ├── styleMock.js │ └── fileMock.js ├── _redirects ├── setupJest.js ├── projectPaths.js └── webpack.js ├── .babelrc ├── .travis.yml ├── .gitignore └── README.md /.prettierignore: -------------------------------------------------------------------------------- 1 | package.json 2 | -------------------------------------------------------------------------------- /client/utils/dataUrlToBlob.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /client/components/Checkbox/styles.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /server/test/feynman.sty: -------------------------------------------------------------------------------- 1 | ../feynman.sty -------------------------------------------------------------------------------- /server/templates/error.tex.tmpl: -------------------------------------------------------------------------------- 1 | error! 2 | -------------------------------------------------------------------------------- /config/__mocks__/styleMock.js: -------------------------------------------------------------------------------- 1 | module.exports = {} -------------------------------------------------------------------------------- /server/templates/diagram.tex.tmpl: -------------------------------------------------------------------------------- 1 | {% .String %} 2 | -------------------------------------------------------------------------------- /config/__mocks__/fileMock.js: -------------------------------------------------------------------------------- 1 | module.exports = 'test-file-stub' -------------------------------------------------------------------------------- /server/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/alecaivazis/feynman 2 | 3 | go 1.17 4 | -------------------------------------------------------------------------------- /client/actions/info/index.js: -------------------------------------------------------------------------------- 1 | export * from './types' 2 | export * from './creators' 3 | -------------------------------------------------------------------------------- /client/interface/Toolbar/utils/index.js: -------------------------------------------------------------------------------- 1 | export anchorsInSpec from './anchorsInSpec' 2 | -------------------------------------------------------------------------------- /client/actions/elements/index.js: -------------------------------------------------------------------------------- 1 | export * from './types' 2 | export * from './creators' 3 | -------------------------------------------------------------------------------- /client/actions/history/index.js: -------------------------------------------------------------------------------- 1 | export * from './types' 2 | export * from './creators' 3 | -------------------------------------------------------------------------------- /client/components/Slider/slider.css: -------------------------------------------------------------------------------- 1 | .rc-slider-track { 2 | background-color: #444 !important; 3 | } -------------------------------------------------------------------------------- /client/interface/Sidebar/GridSizeControl/slider.css: -------------------------------------------------------------------------------- 1 | .rc-slider-track { 2 | background-color: #444 !important; 3 | } -------------------------------------------------------------------------------- /client/interface/Sidebar/ZoomLevelControl/slider.css: -------------------------------------------------------------------------------- 1 | .rc-slider-track { 2 | background-color: #444 !important; 3 | } -------------------------------------------------------------------------------- /client/utils/ceil.js: -------------------------------------------------------------------------------- 1 | const ceilTo = (n, to) => (to === 0 ? n : Math.ceil(n / to) * to) 2 | 3 | export default ceilTo 4 | -------------------------------------------------------------------------------- /client/interface/PatternModal/patterns/blank/preview.js: -------------------------------------------------------------------------------- 1 | // external imports 2 | import React from 'react' 3 | 4 | export default () =>
5 | -------------------------------------------------------------------------------- /client/actions/history/creators/redo.js: -------------------------------------------------------------------------------- 1 | // local imports 2 | import { REDO } from '../types' 3 | 4 | export default msg => ({ 5 | type: REDO, 6 | }) 7 | -------------------------------------------------------------------------------- /client/actions/history/creators/undo.js: -------------------------------------------------------------------------------- 1 | // local imports 2 | import { UNDO } from '../types' 3 | 4 | export default msg => ({ 5 | type: UNDO, 6 | }) 7 | -------------------------------------------------------------------------------- /client/interface/Toolbar/ItemPalette/images/em.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlecAivazis/feynman/HEAD/client/interface/Toolbar/ItemPalette/images/em.png -------------------------------------------------------------------------------- /client/utils/flatMap.js: -------------------------------------------------------------------------------- 1 | // 💪 2 | export default function(arr, lambda) { 3 | return Array.prototype.concat.apply([], (arr || []).map(lambda)) 4 | } 5 | -------------------------------------------------------------------------------- /client/interface/PatternModal/patterns/index.js: -------------------------------------------------------------------------------- 1 | // local imports 2 | import blank from './blank' 3 | import dy from './dy' 4 | 5 | export default [blank, dy] 6 | -------------------------------------------------------------------------------- /client/interface/Toolbar/ItemPalette/images/circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlecAivazis/feynman/HEAD/client/interface/Toolbar/ItemPalette/images/circle.png -------------------------------------------------------------------------------- /client/interface/Toolbar/ItemPalette/images/dashed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlecAivazis/feynman/HEAD/client/interface/Toolbar/ItemPalette/images/dashed.png -------------------------------------------------------------------------------- /client/interface/Toolbar/ItemPalette/images/gluon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlecAivazis/feynman/HEAD/client/interface/Toolbar/ItemPalette/images/gluon.png -------------------------------------------------------------------------------- /client/interface/Toolbar/ItemPalette/images/line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlecAivazis/feynman/HEAD/client/interface/Toolbar/ItemPalette/images/line.png -------------------------------------------------------------------------------- /client/interface/Toolbar/ItemPalette/images/text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlecAivazis/feynman/HEAD/client/interface/Toolbar/ItemPalette/images/text.png -------------------------------------------------------------------------------- /client/interface/Toolbar/SelectionSummary/PropagatorSummary/GluonSummary/styles.js: -------------------------------------------------------------------------------- 1 | export default { 2 | button: { 3 | width: '100%', 4 | }, 5 | } 6 | -------------------------------------------------------------------------------- /client/actions/info/creators/zoomIn.js: -------------------------------------------------------------------------------- 1 | // local imports 2 | import { ZOOM_IN } from 'actions/info/types' 3 | 4 | export default () => ({ 5 | type: ZOOM_IN, 6 | }) 7 | -------------------------------------------------------------------------------- /client/actions/info/creators/zoomOut.js: -------------------------------------------------------------------------------- 1 | // local imports 2 | import { ZOOM_OUT } from 'actions/info/types' 3 | 4 | export default () => ({ 5 | type: ZOOM_OUT, 6 | }) 7 | -------------------------------------------------------------------------------- /server/templates/string.tex.tmpl: -------------------------------------------------------------------------------- 1 | \fontsize{{% .FontSize %}}{{% .BaseLine %}} 2 | \textcolor{{% .Color %}}{{%if .MathMode %}${% end %}{% .String %}{%if .MathMode %}${% end %}} 3 | -------------------------------------------------------------------------------- /client/actions/history/creators/goto.js: -------------------------------------------------------------------------------- 1 | // local imports 2 | import { GOTO } from '../types' 3 | 4 | export default sha => ({ 5 | type: GOTO, 6 | payload: sha, 7 | }) 8 | -------------------------------------------------------------------------------- /client/actions/info/creators/toggleGrid.js: -------------------------------------------------------------------------------- 1 | // local imports 2 | import { TOGGLE_GRID } from 'actions/info/types' 3 | 4 | export default () => ({ 5 | type: TOGGLE_GRID, 6 | }) 7 | -------------------------------------------------------------------------------- /config/_redirects: -------------------------------------------------------------------------------- 1 | # Redirects from what the browser requests to what we serve 2 | 3 | # redirect to the latex service 4 | /latex/* http://104.196.244.203/:splat 200 5 | -------------------------------------------------------------------------------- /client/actions/history/creators/commit.js: -------------------------------------------------------------------------------- 1 | // local imports 2 | import { COMMIT } from '../types' 3 | 4 | export default msg => ({ 5 | type: COMMIT, 6 | payload: msg, 7 | }) 8 | -------------------------------------------------------------------------------- /client/interface/Diagram/Text/styles.js: -------------------------------------------------------------------------------- 1 | export default { 2 | notSelected: { 3 | color: 'black', 4 | }, 5 | selected: { 6 | color: 'blue', 7 | }, 8 | } 9 | -------------------------------------------------------------------------------- /client/interface/Toolbar/SelectionSummary/ShapeSummary/styles.js: -------------------------------------------------------------------------------- 1 | export default { 2 | colorPicker: { 3 | marginLeft: 'auto', 4 | marginRight: 10, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "es2015", 4 | "react", 5 | "stage-0" 6 | ], 7 | "plugins": [ 8 | "transform-decorators-legacy" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /client/actions/info/creators/toggleAnchors.js: -------------------------------------------------------------------------------- 1 | // local imports 2 | import { TOGGLE_ANCHORS } from 'actions/info/types' 3 | 4 | export default () => ({ 5 | type: TOGGLE_ANCHORS, 6 | }) 7 | -------------------------------------------------------------------------------- /client/actions/info/creators/toggleHistory.js: -------------------------------------------------------------------------------- 1 | // local imports 2 | import { TOGGLE_HISTORY } from 'actions/info/types' 3 | 4 | export default () => ({ 5 | type: TOGGLE_HISTORY, 6 | }) 7 | -------------------------------------------------------------------------------- /client/actions/info/creators/toggleHotkeys.js: -------------------------------------------------------------------------------- 1 | // local imports 2 | import { TOGGLE_HOTKEYS } from 'actions/info/types' 3 | 4 | export default () => ({ 5 | type: TOGGLE_HOTKEYS, 6 | }) 7 | -------------------------------------------------------------------------------- /client/interface/Diagram/Grid/styles.js: -------------------------------------------------------------------------------- 1 | import { sighGrey } from 'colors' 2 | 3 | export default { 4 | container: {}, 5 | gridLine: { 6 | stroke: sighGrey, 7 | }, 8 | } 9 | -------------------------------------------------------------------------------- /client/actions/elements/creators/clearElements.js: -------------------------------------------------------------------------------- 1 | // local imports 2 | import { CLEAR_ELEMENTS } from 'actions/elements' 3 | 4 | export default () => ({ 5 | type: CLEAR_ELEMENTS, 6 | }) 7 | -------------------------------------------------------------------------------- /client/actions/elements/creators/clearSelection.js: -------------------------------------------------------------------------------- 1 | // local imports 2 | import { CLEAR_SELECTION } from 'actions/elements' 3 | 4 | export default () => ({ 5 | type: CLEAR_SELECTION, 6 | }) 7 | -------------------------------------------------------------------------------- /client/components/Select/styles.js: -------------------------------------------------------------------------------- 1 | export default { 2 | select: { 3 | backgroundColor: 'white', 4 | height: 24, 5 | fontSize: 12, 6 | }, 7 | option: {}, 8 | } 9 | -------------------------------------------------------------------------------- /client/interface/Sidebar/HistorySummary/styles.js: -------------------------------------------------------------------------------- 1 | export default { 2 | container: { 3 | marginTop: 10, 4 | maxHeight: 110, 5 | overflowY: 'auto', 6 | }, 7 | } 8 | -------------------------------------------------------------------------------- /client/interface/Sidebar/HotkeySummary/styles.js: -------------------------------------------------------------------------------- 1 | export default { 2 | container: { 3 | flexDirection: 'column', 4 | }, 5 | hotkey: { 6 | padding: 7, 7 | }, 8 | } 9 | -------------------------------------------------------------------------------- /client/actions/elements/creators/deleteSelection.js: -------------------------------------------------------------------------------- 1 | // local imports 2 | import { DELETE_SELECTION } from 'actions/elements' 3 | 4 | export default () => ({ 5 | type: DELETE_SELECTION, 6 | }) 7 | -------------------------------------------------------------------------------- /client/actions/info/creators/setZoom.js: -------------------------------------------------------------------------------- 1 | // local imports 2 | import { SET_ZOOM } from 'actions/info/types' 3 | 4 | export default level => ({ 5 | type: SET_ZOOM, 6 | payload: level, 7 | }) 8 | -------------------------------------------------------------------------------- /client/actions/history/creators/index.js: -------------------------------------------------------------------------------- 1 | export commit from './commit' 2 | export goto from './goto' 3 | export redo from './redo' 4 | export undo from './undo' 5 | export withCommit from './withCommit' 6 | -------------------------------------------------------------------------------- /client/actions/info/creators/panDiagram.js: -------------------------------------------------------------------------------- 1 | // local imports 2 | import { PAN_DIAGRAM } from 'actions/info/types' 3 | 4 | export default pan => ({ 5 | type: PAN_DIAGRAM, 6 | payload: pan, 7 | }) 8 | -------------------------------------------------------------------------------- /client/actions/info/creators/toggleExportModal.js: -------------------------------------------------------------------------------- 1 | // local imports 2 | import { TOGGLE_EXPORT_MODAL } from 'actions/info/types' 3 | 4 | export default () => ({ 5 | type: TOGGLE_EXPORT_MODAL, 6 | }) 7 | -------------------------------------------------------------------------------- /config/setupJest.js: -------------------------------------------------------------------------------- 1 | // external imports 2 | import { configure } from 'enzyme' 3 | import Adapter from 'enzyme-adapter-react-16' 4 | import 'babel-polyfill' 5 | 6 | configure({ adapter: new Adapter() }) 7 | -------------------------------------------------------------------------------- /client/actions/elements/creators/splitElement.js: -------------------------------------------------------------------------------- 1 | // local imports 2 | import { SPLIT_ELEMENT } from 'actions/elements' 3 | 4 | export default payload => ({ 5 | type: SPLIT_ELEMENT, 6 | payload, 7 | }) 8 | -------------------------------------------------------------------------------- /client/actions/info/creators/setDiagramTitle.js: -------------------------------------------------------------------------------- 1 | // local imports 2 | import { SET_TITLE } from 'actions/info/types' 3 | 4 | export default title => ({ 5 | type: SET_TITLE, 6 | payload: title, 7 | }) 8 | -------------------------------------------------------------------------------- /client/actions/info/creators/setGridSize.js: -------------------------------------------------------------------------------- 1 | // local imports 2 | import { SET_GRID_SIZE } from 'actions/info/types' 3 | 4 | export default size => ({ 5 | type: SET_GRID_SIZE, 6 | payload: size, 7 | }) 8 | -------------------------------------------------------------------------------- /client/actions/info/creators/togglePatternModal.js: -------------------------------------------------------------------------------- 1 | // local imports 2 | import { TOGGLE_PATTERN_MODAL } from 'actions/info/types' 3 | 4 | export default () => ({ 5 | type: TOGGLE_PATTERN_MODAL, 6 | }) 7 | -------------------------------------------------------------------------------- /client/interface/Diagram/Propagator/styles.js: -------------------------------------------------------------------------------- 1 | import { brightBlue } from 'colors' 2 | 3 | export const selected = { 4 | stroke: brightBlue, 5 | } 6 | 7 | export default { 8 | selected, 9 | } 10 | -------------------------------------------------------------------------------- /client/interface/Toolbar/SelectionSummary/ButtonRow/styles.js: -------------------------------------------------------------------------------- 1 | export default { 2 | container: { 3 | marginTop: 5, 4 | justifyContent: 'center', 5 | padding: '0 30px', 6 | }, 7 | } 8 | -------------------------------------------------------------------------------- /client/interface/Toolbar/SelectionSummary/TextSummary/styles.js: -------------------------------------------------------------------------------- 1 | export default { 2 | container: {}, 3 | input: { 4 | height: 32, 5 | fontSize: 16, 6 | width: '100%', 7 | }, 8 | } 9 | -------------------------------------------------------------------------------- /client/utils/round.js: -------------------------------------------------------------------------------- 1 | // if we are rounding to zero, don't round at all. Otherwise, round to the nearest bucket 2 | const round = (n, to) => (to === 0 ? n : Math.round(n / to) * to) 3 | 4 | export default round 5 | -------------------------------------------------------------------------------- /client/actions/elements/creators/addAnchors.js: -------------------------------------------------------------------------------- 1 | // local imports 2 | import { ADD_ANCHORS } from 'actions/elements' 3 | 4 | export default (...anchors) => ({ 5 | type: ADD_ANCHORS, 6 | payload: anchors, 7 | }) 8 | -------------------------------------------------------------------------------- /client/actions/elements/creators/loadDiagram.js: -------------------------------------------------------------------------------- 1 | // local imports 2 | import { LOAD_DIAGRAM } from 'actions/elements' 3 | 4 | export default diagram => ({ 5 | type: LOAD_DIAGRAM, 6 | payload: diagram, 7 | }) 8 | -------------------------------------------------------------------------------- /client/actions/elements/creators/loadPattern.js: -------------------------------------------------------------------------------- 1 | // local imports 2 | import { LOAD_PATTERN } from 'actions/elements' 3 | 4 | export default pattern => ({ 5 | type: LOAD_PATTERN, 6 | payload: pattern, 7 | }) 8 | -------------------------------------------------------------------------------- /client/actions/elements/creators/snapSelectedElements.js: -------------------------------------------------------------------------------- 1 | // local imports 2 | import { SNAP_SELECTED_ELEMENTS } from 'actions/elements' 3 | 4 | export default pattern => ({ 5 | type: SNAP_SELECTED_ELEMENTS, 6 | }) 7 | -------------------------------------------------------------------------------- /client/actions/elements/creators/deleteElements.js: -------------------------------------------------------------------------------- 1 | // local imports 2 | import { DELETE_ELEMENTS } from '../types' 3 | 4 | export default (...targets) => ({ 5 | type: DELETE_ELEMENTS, 6 | payload: targets, 7 | }) 8 | -------------------------------------------------------------------------------- /client/actions/elements/creators/placeElement.js: -------------------------------------------------------------------------------- 1 | // local imports 2 | import { PLACE_ELEMENTS } from 'actions/elements' 3 | 4 | export default element => ({ 5 | type: PLACE_ELEMENTS, 6 | payload: element, 7 | }) 8 | -------------------------------------------------------------------------------- /client/actions/elements/creators/setElementAttrs.js: -------------------------------------------------------------------------------- 1 | // local imports 2 | import { SET_ELEMENT_ATTRS } from '../types' 3 | 4 | export default (...updates) => ({ 5 | type: SET_ELEMENT_ATTRS, 6 | payload: updates, 7 | }) 8 | -------------------------------------------------------------------------------- /client/actions/elements/creators/moveSelectedElements.js: -------------------------------------------------------------------------------- 1 | // local imports 2 | import { MOVE_SELECTED_ELEMENTS } from '../types' 3 | 4 | export default move => ({ 5 | type: MOVE_SELECTED_ELEMENTS, 6 | payload: move, 7 | }) 8 | -------------------------------------------------------------------------------- /client/actions/elements/creators/selectElements.js: -------------------------------------------------------------------------------- 1 | // local imports 2 | import { SELECT_ELEMENTS } from 'actions/elements' 3 | 4 | export default (...selection) => ({ 5 | type: SELECT_ELEMENTS, 6 | payload: selection, 7 | }) 8 | -------------------------------------------------------------------------------- /client/actions/elements/creators/addPropagators.js: -------------------------------------------------------------------------------- 1 | // local imports 2 | import { ADD_PROPAGATORS } from 'actions/elements' 3 | 4 | export default (...propagators) => ({ 5 | type: ADD_PROPAGATORS, 6 | payload: propagators, 7 | }) 8 | -------------------------------------------------------------------------------- /client/actions/elements/creators/setAnchorLocations.js: -------------------------------------------------------------------------------- 1 | // local imports 2 | import { SET_ANCHOR_LOCATIONS } from 'actions/elements' 3 | 4 | export default (...anchors) => ({ 5 | type: SET_ANCHOR_LOCATIONS, 6 | payload: anchors, 7 | }) 8 | -------------------------------------------------------------------------------- /client/interface/Diagram/Propagator/Fermion/styles.js: -------------------------------------------------------------------------------- 1 | // local imports 2 | import { selected } from '../styles' 3 | 4 | export default { 5 | container: {}, 6 | selected: { 7 | fill: selected.stroke, 8 | }, 9 | } 10 | -------------------------------------------------------------------------------- /client/interface/Toolbar/SelectionSummary/Container/styles.js: -------------------------------------------------------------------------------- 1 | export default { 2 | container: { 3 | display: 'flex', 4 | flexDirection: 'column', 5 | alignItems: 'center', 6 | flexGrow: 1, 7 | }, 8 | } 9 | -------------------------------------------------------------------------------- /client/actions/elements/creators/alignSelectedAnchors.js: -------------------------------------------------------------------------------- 1 | // local imports 2 | import { ALIGN_SELECTED_ANCHORS } from 'actions/elements' 3 | 4 | export default direction => ({ 5 | type: ALIGN_SELECTED_ANCHORS, 6 | payload: direction, 7 | }) 8 | -------------------------------------------------------------------------------- /client/actions/history/types.js: -------------------------------------------------------------------------------- 1 | export const COMMIT = '@history/COMMIT' 2 | export const UNDO = '@history/UNDO' 3 | export const REDO = '@history/REDO' 4 | export const GOTO = '@history/GOTO' 5 | export const WITH_COMMIT = '@history/WITH_COMMIT' 6 | -------------------------------------------------------------------------------- /server/charts/service.yaml: -------------------------------------------------------------------------------- 1 | kind: Service 2 | apiVersion: v1 3 | metadata: 4 | name: latex 5 | spec: 6 | type: LoadBalancer 7 | selector: 8 | app: latex 9 | ports: 10 | - protocol: TCP 11 | port: 80 12 | targetPort: 8081 13 | -------------------------------------------------------------------------------- /client/interface/Toolbar/ItemPalette/images/index.js: -------------------------------------------------------------------------------- 1 | export circle from './circle.png' 2 | export dashed from './dashed.png' 3 | export em from './em.png' 4 | export gluon from './gluon.png' 5 | export line from './line.png' 6 | export text from './text.png' 7 | -------------------------------------------------------------------------------- /client/actions/history/creators/withCommit.js: -------------------------------------------------------------------------------- 1 | // local imports 2 | import { WITH_COMMIT } from '../types' 3 | 4 | export default (action, message) => ({ 5 | type: WITH_COMMIT, 6 | payload: { 7 | action, 8 | message, 9 | }, 10 | }) 11 | -------------------------------------------------------------------------------- /client/components/Select/option.js: -------------------------------------------------------------------------------- 1 | // external imports 2 | import React from 'react' 3 | // local imports 4 | import styles from './styles' 5 | 6 | const Option = ({ ...unusedProps }) =>