Sign inSign up

janvda/niamondo-editor

By janvda

Updated over 1 year ago

Image
0

2.6K

janvda/niamondo-editor repository overview

niamondo-editor

Editor for the game niamondo.

Add /ui to the service URL to get the editor !

Functionalities

It covers following functionalities:

  1. backup and restore of sqlite DB to/from our network drive.
  2. card editor
  3. production card editor
  4. country cards generator
  5. game support cards generator
1. backup and restore

Allows to backup and restore the SQLite DB to/from our network drive which should be mounted to mount point /nfs in the container.

So when changes are made by the card editor or production card editor they can easily be copied to our network drive (Western Digital).

Note that by using the following make command on my build machine (macbook) they can be copied from our network drive to my build machine for checkin in github and building the images with new sqlite DB.

make local_db
2. Card editor

Allows to create new cards and edit existing cards of the deck.

It is possible to paste a clipboard image in the File Upload box but this only works on Chrome with https !

3. Production card editor

Allows to create and edit production cards based on the statistics downloaded from the sites:

[5.] Check/Add country codes to percentages

When clicking on CHECK button it might report code_mismatches like

{
  "code_mismatch_entity": true,
  "update_needed": false,
  "update_possible": true,
  "code_mismatches": [
    {
      "Entity": "Czechia",
      "Code": "CZE",
      "Year": 2022,
      "total": 115140,
      "percentage": 1,
      "code_matches_entity": false
    }
  ],
  "cannot_be_updated": [
    null
  ]
}

So this means that entity name Czechia is not an existing country name (the proper name is Czech Republic), in this case it has specified Code CZE which is indeed the proper country code.

By clicking on UPDATE PERCENTAGES it will update the percentages using the proper country name.

4. Country card generator
  1. Allows to generate a html page with 9 country cards.
  2. The generated html page can be accessed by adding /countries to the domain name.
  3. You can easily generate a PDF version by printing this page with Destination = save as PDF.
  4. This PDF can then be printed on A4 card board paper. Set print option scaling to 100% (don't use option "photo" with borderless printing as then 3 mm at the left and 3mm at the top will be missing) !
  5. The 9 countries can then be cut out of the printed paper using a paper cutter.
  6. The corners can be rounded (if needed)
  7. The card can be put into a plastic card sleeve with size 63mmx92mm. The following sleeves with size 2 5/8 inch (66.675 mm) x 3 5/8 inch (92.075 cm) are big enough:
4. Game support cards generator

Allows to generate a html page that can be printed for supporting the game play. Following html pages can be generated this way:

  • add /income_total to URL : prints 6 cards on a page that allows the player to keep track of his current total income of all country cards.
  • add /production_tariff_card to URL : prints 6 cards on a page summarizing the rules for a production card.
  • add /end_score_cards to URL : prints 6 cards on a page that helps calculating the end score for all players.

So you can print those html pages to PDF and then print these PDFs on your printer. When printing the PDF on your printer:

  • the paper format must be A4,
  • choose borderless printing option and
  • in most cases set scaling to 99% so that everything fits on the page.

Interesting

Converting to magellan coordinates
countries ~> | $ | (
    $capital_coord := (capital_location~>$eval()).geometry.coordinates; /* [60.91640625,-48.89926757812499];   */
    $longitude := $capital_coord[0];
    $latitude  := $capital_coord[1];
   {
       "capital_direction" : capital_direction=null ? "bottom" : capital_direction,
       "capital_coord" : $capital_coord,
       "capital_magellan_coord" :    
            /* latitude part. e.g. "5 N" or "7 S" */ 
            ($latitude > 0 
            ?  (((($latitude/10)~>$floor())+1)~>$string()) & "N "
            :  ((((-$latitude/10)~>$floor())+1)~>$string()) & "S " )   &
             /* append longitude part (1-36) */ 
            ( (((( $longitude < 0 ? $longitude+360 : $longitude)/10)~>$floor())+1)~>$string())  
    } 
) |

GitHub location

janvda/niamondo:editor

docker-compose example

TO BE DONE

Change History

  • version 3.13.2 : fixes to process https://www.usgs.gov stats
  • version 3.13.1 : minor fixes / updates (including production cards)
  • version 3.13.0 : updated production cards based on https://ourworldindata.org/
  • version 3.12.0 : based on image janvda/node-red-sqlite:4.0.2-22 (not for arm v7 architecture)
  • version 3.11.0 : added 10 new geography cards (see #16 add geography cards)
  • version 3.10.1 : fix issue due to missing geojson data for the capital of Faroe Islands
  • version 3.10.0 : added 'countries' : Iceland, Faroe Islands, Greenland, Antarctica.
  • version 3.9.0 : based on image janvda/node-red-sqlite:3.1.0-18
  • version 3.8.1 : Fix for issue #55 production card editor - doesn't properly recognize stats for beans (owid)
  • version 3.8.0 : updated production cards and 2 other cards
  • version 3.7.1 : added missing package worldmap
  • version 3.7.0 : added /end_score_cards that helps calculating the end score, #37 for gas, oil and coal show MWh electricity and kg CO2/person, geography tab added, country card stores also map bounds and zoom level, many more changes.
  • version 3.6.0 : added get /income_total and get /production_tariff_card to generate game supporting cards.
  • version 3.5.0 : country card editor: fixed issue with new caledonia, adapted to magic card size, add capital location coordinates; QR code changes, added military personnel, ... ; also handles html tables without records;
  • version 3.4.0 : added 6 production cards having state statistics
  • version 3.3.0 : updated production by state stats (60 in total): coffee, cacao, palm oil, cashew, banana
  • version 3.2.0 : several editor changes - updated several owid production statistis (from 2018 to 2020) + added several production by state (56 in total): rice, zinc, barley, ...
  • version 3.1.0 : production and production by state improvements + more production by state statistics (42 in total): cobalt, nickel, copper, lithium, wild fish catch.
  • version 3.0.0 : added web page tab for creating production by state statistics + added production by state statistics (33 in total): oil, gas, wind, solar, water power, nuclear, bio fuels, uranium, rare earths
  • version 2.5.1 : applied same fix as deck:2.7.0 - so url,mission, active is also returned when getting card details.
  • version 2.5.0 : added integration flows for openai and stat., handled new table production_by_state and populated it already with some data, also displayed production by state information on production card.
  • version 2.4.0 : added another 6 geography cards: Sebastopol, Ho Chi Minh, Lumumbashi, Samarkand, Manaus and Assouan
  • version 2.3.0 : added geography cards
  • version 2.2.0 : added production card: oil reserves
  • version 2.1.3 : minor changes to niamondo.db (mainly cleanup)
  • version 2.1.2 : fixed production card editor for upload of USGS statistics + new production cards: silver, salt, tin, copper, nickel, grahite, zinc, silicon, rare earth elements, uranium
  • version 2.1.1 : production per person is put in proper unit
  • version 2.1.0 : used niamondo.db (no blobs) and geojson files.
  • version 1.0.2 : based on docker image janvda/node-red-sqlite:3.0.2-16
  • version 1.0.1 : initial version of the editor

Tag summary

Content type

Image

Digest

sha256:b47fd2e97

Size

308.4 MB

Last updated

over 1 year ago

docker pull janvda/niamondo-editor