{"id":32299446,"url":"https://github.com/sjhorn/visicalc_engine","last_synced_at":"2025-10-30T09:35:04.878Z","repository":{"id":230544711,"uuid":"779604244","full_name":"sjhorn/visicalc_engine","owner":"sjhorn","description":" A clone of the visicalc spreadsheet engine in dart","archived":false,"fork":false,"pushed_at":"2024-04-16T13:07:54.000Z","size":333,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-23T05:02:10.035Z","etag":null,"topics":["a1-notation","petitparser","spreadsheet","visicalc","worksheet"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sjhorn.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null}},"created_at":"2024-03-30T09:26:49.000Z","updated_at":"2024-12-19T00:30:27.000Z","dependencies_parsed_at":"2024-04-03T17:28:22.243Z","dependency_job_id":"1bb420cb-7ef5-493b-9404-9dfc87fabf5c","html_url":"https://github.com/sjhorn/visicalc_engine","commit_stats":null,"previous_names":["sjhorn/visicalc_engine"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sjhorn/visicalc_engine","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjhorn%2Fvisicalc_engine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjhorn%2Fvisicalc_engine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjhorn%2Fvisicalc_engine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjhorn%2Fvisicalc_engine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sjhorn","download_url":"https://codeload.github.com/sjhorn/visicalc_engine/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjhorn%2Fvisicalc_engine/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280563556,"owners_count":26351731,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-23T02:00:06.710Z","response_time":142,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["a1-notation","petitparser","spreadsheet","visicalc","worksheet"],"created_at":"2025-10-23T05:01:41.271Z","updated_at":"2025-10-23T05:02:40.787Z","avatar_url":"https://github.com/sjhorn.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VisiCalc Engine Package\n[![Pub Package](https://img.shields.io/pub/v/visicalc_engine.svg)](https://pub.dev/packages/visicalc_engine)\n[![Build Status](https://github.com/sjhorn/visicalc_engine/actions/workflows/dart.yml/badge.svg?branch=main)](https://github.com/sjhorn/visicalc_engine/actions)\n[![codecov](https://codecov.io/gh/sjhorn/visicalc_engine/graph/badge.svg?token=78WVGR0OHY)](https://codecov.io/gh/sjhorn/visicalc_engine)\n[![GitHub Issues](https://img.shields.io/github/issues/sjhorn/visicalc_engine.svg)](https://github.com/sjhorn/visicalc_engine/issues)\n[![GitHub Forks](https://img.shields.io/github/forks/sjhorn/visicalc_engine.svg)](https://github.com/sjhorn/visicalc_engine/network)\n[![GitHub Stars](https://img.shields.io/github/stars/sjhorn/visicalc_engine.svg)](https://github.com/sjhorn/visicalc_engine/stargazers)\n![GitHub License](https://img.shields.io/github/license/sjhorn/visicalc_engine)\n\nThis package implements a clone of the VisiCalc spreadsheet engine in a dart library that works by parsing the strings of cells (Map\u003cA1,String\u003e) and calculating the result considering references to other cells.\n\nThe screenshot below shows the original user interface of Visicalc made by [Dan Bricklin and Bob Frankston](https://danbricklin.com/visicalc.htm).\n![VisiCalc Logo from Wikipedia](https://upload.wikimedia.org/wikipedia/commons/thumb/8/8f/Visicalc_logo.svg/320px-Visicalc_logo.svg.png)\n![VisiCalc Spreadsheet User Interface](https://upload.wikimedia.org/wikipedia/commons/7/7a/Visicalc.png)\n\nFrom [wikipedia](https://en.wikipedia.org/wiki/VisiCalc) \n\n\u003e VisiCalc (\"visible calculator\") is the first spreadsheet computer program for personal computers, originally released for Apple II by VisiCorp on October 17, 1979.It is considered the killer application for the Apple II, turning the microcomputer from a hobby for computer enthusiasts into a serious business tool, and then prompting IBM to introduce the IBM PC two years later.More than 700,000 copies were sold in six years, and up to 1 million copies over its history\n\n\n## Features\n\n - Supports the calculation and reference language from VisiCalc explained in the [reference card](https://www.bricklin.com/history/refcard1.htm)\n\n ![Reference Card](https://raw.github.com/sjhorn/visicalc_engine/main/assets/refcard.png)\n\n## Getting started\n\nSimple usage examples below:\n\n```dart\nimport 'package:a1/a1.dart';\nimport 'package:visicalc_engine/visicalc_engine.dart';\n\nvoid main(List\u003cString\u003e arguments) {\n   final sheet = {\n    'A1'.a1: '/FR-12.2',\n    'A2'.a1: '(a5+45)',\n    'A3'.a1: '/F*13',\n    'A4'.a1: '+A2+A5-A6',\n    'A5'.a1: '-A3/2+2',\n    'A6'.a1: '/F\\$.23*2',\n    'B1'.a1: '+A1+A3*3',\n    'B2'.a1: '(A1+A3)*3',\n    'B3'.a1: '12.23e-12',\n    'B4'.a1: '.23e12',\n    'B5'.a1: '/FRb4',\n    'B6'.a1: '+b2',\n    'B7'.a1: '@sum(a1...b6)',\n    'D13'.a1: '+b2',\n  };\n  final worksheet = Engine.fromMap(sheet, parseErrorThrows: true);\n  print(worksheet);\n\n  // Change cell\n  var b5 = worksheet[\"B5\".a1];\n  print('B5 formula was ${b5?.formulaType?.asFormula} = $b5');\n  print('Now setting B5 to formula a1');\n  worksheet['B5'.a1] = '+a1';\n\n  b5 = worksheet[\"B5\".a1];\n  print('Now B5 formula is ${b5?.formulaType?.asFormula} = $b5');\n  print(worksheet);\n  print('Output to a .vc file\\n: ${worksheet.toFileContents()}');\n\n  // .vc file example\n  final fileContents = '''\\\n\u003eA1:/FL\"TRUE\\r\n\u003eA2:+B5*10\\r\n\u003eA3:+B3+1\\r\n\u003eA4:\"tes\\r\n\u003eA5:@SUM(B2...B5)\\r\n\u003eB1:/FR\"label\\r\n\u003eB2:123\\r\n\u003eB3:@PI\\r\n\u003eB4:+B3\\r\n\u003eB5:.23*2\\r\n\\u0000''';\n  print('Parsing an example of a VisiCalc .vc file format');\n  final engine = Engine.fromFileContents(fileContents);\n  print(engine);\n}\n```\n\nThe result looks as follows:\n```\n         A fx           |          A           |       B fx           |          B           |       C fx           |          C           |       D fx           |          D           | \n---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n 1  -12.2                |                -12.2 | +A1+A3*3             | 26.8                 |                      |                      |                      |                      | \n 2  (A5+45)              | 40.5                 | (A1+A3)*3            | 2.4                  |                      |                      |                      |                      | \n 3  13                   | ********             | 1.223e-11            | 1.223e-11            |                      |                      |                      |                      | \n 4  +A2+A5-A6            | 35.54                | 230000000000         | 230000000000         |                      |                      |                      |                      | \n 5  -A3/2+2              | -4.5                 | B4                   |         230000000000 |                      |                      |                      |                      | \n 6  0.23*2               | 0.46                 | +B2                  | 2.4                  |                      |                      |                      |                      | \n 7                       |                      | @SUM(A1...B6)        | 460000000104.4000244 |                      |                      |                      |                      | \n 8                       |                      |                      |                      |                      |                      |                      |                      | \n 9                       |                      |                      |                      |                      |                      |                      |                      | \n10                       |                      |                      |                      |                      |                      |                      |                      | \n11                       |                      |                      |                      |                      |                      |                      |                      | \n12                       |                      |                      |                      |                      |                      |                      |                      | \n13                       |                      |                      |                      |                      |                      | +B2                  | 2.4                  | \n\nB5 formula was B4 = 230000000000\nNow setting B5 to formula a1\nNow B5 formula is +A1 = -12.2\n          A fx           |          A           |       B fx           |          B           |       C fx           |          C           |       D fx           |          D           | \n---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n 1  -12.2                |                -12.2 | +A1+A3*3             | 26.8                 |                      |                      |                      |                      | \n 2  (A5+45)              | 40.5                 | (A1+A3)*3            | 2.4                  |                      |                      |                      |                      | \n 3  13                   | ********             | 1.223e-11            | 1.223e-11            |                      |                      |                      |                      | \n 4  +A2+A5-A6            | 35.54                | 230000000000         | 230000000000         |                      |                      |                      |                      | \n 5  -A3/2+2              | -4.5                 | +A1                  | -12.2                |                      |                      |                      |                      | \n 6  0.23*2               | 0.46                 | +B2                  | 2.4                  |                      |                      |                      |                      | \n 7                       |                      | @SUM(A1...B6)        | 230000000092.1999816 |                      |                      |                      |                      | \n 8                       |                      |                      |                      |                      |                      |                      |                      | \n 9                       |                      |                      |                      |                      |                      |                      |                      | \n10                       |                      |                      |                      |                      |                      |                      |                      | \n11                       |                      |                      |                      |                      |                      |                      |                      | \n12                       |                      |                      |                      |                      |                      |                      |                      | \n13                       |                      |                      |                      |                      |                      | +B2                  | 2.4                  | \n\nOutput to a .vc file\n: \u003eD13:+B2\n\u003eB7:@SUM(A1...B6)\n\u003eB6:+B2\n\u003eA6:/F$0.23*2\n\u003eB5:+A1\n\u003eA5:-A3/2+2\n\u003eB4:230000000000\n\u003eA4:+A2+A5-A6\n\u003eB3:1.223e-11\n\u003eA3:/F*13\n\u003eB2:(A1+A3)*3\n\u003eA2:(A5+45)\n\u003eB1:+A1+A3*3\n\u003eA1:/FR-12.2\n\nParsing an example of a VisiCalc .vc file format\n          A fx           |          A           |       B fx           |          B           | \n-----------------------------------------------------------------------------------------------\n 1  \"TRUE                | TRUE                 | \"label               |                label | \n 2  +B5*10               | 4.6                  | 123                  | 123                  | \n 3  +B3+1                | 4.1415926536         | @PI                  | 3.1415926536         | \n 4  \"tes                 | tes                  | +B3                  | 3.1415926536         | \n 5  @SUM(B2...B5)        | 129.7431853072       | 0.23*2               | 0.46                 | \n```\n\n\nThe `test/` directory explores other use cases for the visicalc_engine types and library.\n\n## Usage\n\nThe code above in getting started is also available in the `example/example.dart`\n\n## Reference\n\n* The [Visicalc user interface and logo](https://en.wikipedia.org/wiki/VisiCalc) are referenced from wikipeida.\n* The parsing depends on the great library [petitparser](https://pub.dev/packages/petitparser) by Lukas Renggli.\n* For A1 Notation we leverage the a1 library [a1](https://pub.dev/packages/a1).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsjhorn%2Fvisicalc_engine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsjhorn%2Fvisicalc_engine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsjhorn%2Fvisicalc_engine/lists"}