Skip to content

Commit

Permalink
docs: Document exported components
Browse files Browse the repository at this point in the history
  • Loading branch information
raulsteurer committed Sep 29, 2023
1 parent e26fd62 commit 898f2e2
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 2 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 🌲 @treely/forest-management

The @treely/forest-management module contains components that are used to
create feasibility studies for proposed forest based CO2 reduction projects.
calculate key parameters for the management of forests.

## Usage

Expand All @@ -11,10 +11,17 @@ versions of Next.js that are newer than 11.0.0.
It is nessacary to wrap the components in the `ForestManagementProvider` component.
Projects that need to support the german language can set the `locale` prop to `de`.
If you are also using `@chakra-ui/react` or `boemly`, make sure to have `ChakraProvider`
or `BoemlyThemeProvider` as a _parent_ of `ForestManagementProvider`.
or `BoemlyThemeProvider` as a _child_ of `ForestManagementProvider`.

```tsx
<ForestManagementProvider locale={"en" || "de"}>
<Forestry config={...}>
</ForestManagementProvider>
```

## Components

- [CalculateCurrentStock](./src/components/CalculateCurrentStock)
- [Forestry](./src/components/Forestry)
- [OperationClass](./src/components/OperationClass)
- [OperationClasses](./src/components/OperationClasses)
27 changes: 27 additions & 0 deletions src/components/CalculateCurrentStock/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# CalculateCurrentStock

The CalculateCurrentStock component allows you to determine the average increment per
year, average harvest amount per year, stock in the year of inventory, and current
stock. Additionally, it handles edge cases where one year of harvest amounts is missing
between the two points in time.

## Input

- `config`: A object of type `FeasibilityConfig`

## Output

- Average increment per year (Durchschnittlicher Zuwachs pro Jahr): This metric represents
the average annual increment in volume in Vfm per hectare.
- Average harvest amount per year (Durchschnittlicher Einschlag pro Jahr): This metric
calculates the average annual harvest amount in Efm (cubic meters).
- Stock in the year of inventory: The volume in Vfm per hectare for the specified "Current"
year.
- Current stock: The calculated current stock in volume, considering the initial stock,
yearly increment, and harvest data up to the "Current" year.

## Edge Cases

The CalculateCurrentStock component is designed to handle edge cases, specifically
when one year of harvest amounts is missing between the two points in time. It will
accurately reflect this scenario in the output, ensuring transparency and data accuracy.
15 changes: 15 additions & 0 deletions src/components/Forestry/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Forestry

The Forestry component calculates the normal stock for the entire forest operation.
It displays a table of all operation classes with their respective stock, total area
and relative area.

## Input

- `config`: A object of type `FeasibilityConfig`

## Output

- Normal stock (Normalvorrat): The normal stock in Vfm per hectare for each operation class.
- Area (Fläche): The total area in hectares for each operation class.
- Area distribution (Flächenverteilung): The relative area in percent for each operation class.
18 changes: 18 additions & 0 deletions src/components/OperationClass/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# OperationClass

The OperationClass component calculates the absolute and relative area, the site productivity,
the normal stock for each specie and the yield table that corresponds to the given specie.

## Input

- `rotationPeriod`: The rotation period in years.
- `listOfSpecies`: A list of species with their site productivity (Bonität) and respective area
in hectares or in percent.

## Output

- Yield table (Ertragstafel): A link to the yield table that corresponds to the given specie.
- Area (Fläche): The total area in hectares for each specie.
- Area distribution (Flächenverteilung): The relative area in percent for each operation class.
- Site productivity (Bonität): The site productivity for each specie.
- Normal stock (Normalvorrat): The normal stock in Vfm per hectare for each specie.
13 changes: 13 additions & 0 deletions src/components/OperationClasses/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# OperationClasses

The OperationClasses component applies the [OperationClass](../OperationClass)
component to each operation class of a feasibility study.

## Input

- `config`: The configuration object of the feasibility study.

## Output

- `OperationClass`: The [OperationClass](../OperationClass) component
for each operation class of the feasibility study.

0 comments on commit 898f2e2

Please sign in to comment.